|
@@ -2856,48 +2856,53 @@ bool AfterLoadGame()
|
|
|
v->acceleration = avi->acceleration;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* Blocked tiles could be reserved due to a bug, which causes
|
|
|
* other places to assert upon e.g. station reconstruction. */
|
|
|
for (auto t : Map::Iterate()) {
|
|
|
if (HasStationTileRail(t) && IsStationTileBlocked(t)) {
|
|
|
SetRailStationReservation(t, false);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (IsSavegameVersionBefore(SLV_184)) {
|
|
|
/* The global units configuration is split up in multiple configurations. */
|
|
|
extern uint8 _old_units;
|
|
|
_settings_game.locale.units_velocity = Clamp(_old_units, 0, 2);
|
|
|
_settings_game.locale.units_power = Clamp(_old_units, 0, 2);
|
|
|
_settings_game.locale.units_weight = Clamp(_old_units, 1, 2);
|
|
|
_settings_game.locale.units_volume = Clamp(_old_units, 1, 2);
|
|
|
_settings_game.locale.units_force = 2;
|
|
|
_settings_game.locale.units_height = Clamp(_old_units, 0, 2);
|
|
|
}
|
|
|
|
|
|
if (IsSavegameVersionBefore(SLV_VELOCITY_NAUTICAL)) {
|
|
|
/* Match nautical velocity with land velocity units. */
|
|
|
_settings_game.locale.units_velocity_nautical = _settings_game.locale.units_velocity;
|
|
|
}
|
|
|
|
|
|
if (IsSavegameVersionBefore(SLV_186)) {
|
|
|
/* Move ObjectType from map to pool */
|
|
|
for (auto t : Map::Iterate()) {
|
|
|
if (IsTileType(t, MP_OBJECT)) {
|
|
|
Object *o = Object::Get(t.m2());
|
|
|
o->type = t.m5();
|
|
|
t.m5() = 0; // zero upper bits of (now bigger) ObjectID
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* In version 2.2 of the savegame, we have new airports, so status of all aircraft is reset.
|
|
|
* This has to be called after all map array updates */
|
|
|
if (IsSavegameVersionBefore(SLV_2, 2)) UpdateOldAircraft();
|
|
|
|
|
|
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. */
|
|
|
bool roadside = _settings_game.vehicle.road_side == 1;
|
|
|
std::vector<uint> skip_frames;
|
|
|
for (RoadVehicle *v : RoadVehicle::Iterate()) {
|