Merge branch 'master' into jgrpp

Bump savegame for water regions for ship pathfinder
Use ring_buffer for ShipPathCache
This commit is contained in:
Jonathan G Rennison
2024-01-09 16:30:06 +00:00
45 changed files with 1406 additions and 332 deletions

View File

@@ -309,13 +309,9 @@ public:
if (v->type != VEH_SHIP) return;
SlObject(v, this->GetLoadDescription());
if (!_path_td.empty() && _path_td.size() <= SHIP_PATH_CACHE_LENGTH) {
if (!_path_td.empty()) {
Ship *s = Ship::From(v);
s->cached_path.reset(new ShipPathCache());
s->cached_path->count = (uint8_t)_path_td.size();
for (size_t i = 0; i < _path_td.size(); i++) {
s->cached_path->td[i] = _path_td[i];
}
s->cached_path.insert(s->cached_path.end(), _path_td.begin(), _path_td.end());
}
_path_td.clear();
}