Avoid unnecessary calls to SettingsDisableElrail in AfterLoadGame

This commit is contained in:
Jonathan G Rennison
2019-09-23 20:29:32 +01:00
parent 13138bd97b
commit 5008a09fe9

View File

@@ -1680,8 +1680,11 @@ bool AfterLoadGame()
/* from version 38 we have optional elrails, since we cannot know the
* preference of a user, let elrails enabled; it can be disabled manually */
if (IsSavegameVersionBefore(SLV_38)) _settings_game.vehicle.disable_elrails = false;
/* do the same as when elrails were enabled/disabled manually just now */
SettingsDisableElrail(_settings_game.vehicle.disable_elrails);
if (IsSavegameVersionBefore(SLV_38) || _settings_game.vehicle.disable_elrails) {
SettingsDisableElrail(_settings_game.vehicle.disable_elrails);
} else {
ReinitGuiAfterToggleElrail(_settings_game.vehicle.disable_elrails);
}
InitializeRailGUI();
/* From version 53, the map array was changed for house tiles to allow