|
@@ -2186,25 +2186,25 @@ bool AfterLoadGame()
|
|
|
assert_compile(CargoPaymentPool::MAX_SIZE == VehiclePool::MAX_SIZE);
|
|
|
assert(CargoPayment::CanAllocateItem());
|
|
|
Vehicle *v = *iter;
|
|
|
if (v->cargo_payment == NULL) v->cargo_payment = new CargoPayment(v);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (IsSavegameVersionBefore(SLV_122)) {
|
|
|
/* Animated tiles would sometimes not be actually animated or
|
|
|
* in case of old savegames duplicate. */
|
|
|
|
|
|
extern SmallVector<TileIndex, 256> _animated_tiles;
|
|
|
extern std::vector<TileIndex> _animated_tiles;
|
|
|
|
|
|
for (auto tile = _animated_tiles.begin(); tile < _animated_tiles.end(); /* Nothing */) {
|
|
|
/* Remove if tile is not animated */
|
|
|
bool remove = _tile_type_procs[GetTileType(*tile)]->animate_tile_proc == NULL;
|
|
|
|
|
|
/* and remove if duplicate */
|
|
|
for (auto j = _animated_tiles.begin(); !remove && j < tile; j++) {
|
|
|
remove = *tile == *j;
|
|
|
}
|
|
|
|
|
|
if (remove) {
|
|
|
DeleteAnimatedTile(*tile);
|
|
@@ -2930,25 +2930,25 @@ bool AfterLoadGame()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (IsSavegameVersionBefore(SLV_188)) {
|
|
|
/* Fix articulated road vehicles.
|
|
|
* Some curves were shorter than other curves.
|
|
|
* Now they have the same length, but that means that trailing articulated parts will
|
|
|
* take longer to go through the curve than the parts in front which already left the courve.
|
|
|
* So, make articulated parts catch up. */
|
|
|
RoadVehicle *v;
|
|
|
bool roadside = _settings_game.vehicle.road_side == 1;
|
|
|
SmallVector<uint, 16> skip_frames;
|
|
|
std::vector<uint> skip_frames;
|
|
|
FOR_ALL_ROADVEHICLES(v) {
|
|
|
if (!v->IsFrontEngine()) continue;
|
|
|
skip_frames.clear();
|
|
|
TileIndex prev_tile = v->tile;
|
|
|
uint prev_tile_skip = 0;
|
|
|
uint cur_skip = 0;
|
|
|
for (RoadVehicle *u = v; u != NULL; u = u->Next()) {
|
|
|
if (u->tile != prev_tile) {
|
|
|
prev_tile_skip = cur_skip;
|
|
|
prev_tile = u->tile;
|
|
|
} else {
|
|
|
cur_skip = prev_tile_skip;
|