Add road vehicle flags for whether any part is on level crossing

This commit is contained in:
Jonathan G Rennison
2023-09-10 13:43:13 +01:00
parent 18a40df10e
commit c6ce9ce687
8 changed files with 32 additions and 0 deletions

View File

@@ -4237,6 +4237,14 @@ bool AfterLoadGame()
_settings_game.economy.tick_rate = IsSavegameVersionUntil(SLV_MORE_CARGO_AGE) ? TRM_TRADITIONAL : TRM_MODERN;
}
if (SlXvIsFeatureMissing(XSLFI_ROAD_VEH_FLAGS)) {
for (RoadVehicle *rv : RoadVehicle::Iterate()) {
if (IsLevelCrossingTile(rv->tile)) {
SetBit(rv->First()->rvflags, RVF_ON_LEVEL_CROSSING);
}
}
}
if (SlXvIsFeatureMissing(XSLFI_AI_START_DATE) && IsSavegameVersionBefore(SLV_AI_START_DATE)) {
/* For older savegames, we don't now the actual interval; so set it to the newgame value. */
_settings_game.difficulty.competitors_interval = _settings_newgame.difficulty.competitors_interval;