@ -985,17 +985,6 @@ bool AfterLoadGame()
* filled ; and that could eventually lead to desyncs . */
* filled ; and that could eventually lead to desyncs . */
CargoPacket : : AfterLoad ( ) ;
CargoPacket : : AfterLoad ( ) ;
/* Oilrig was moved from id 15 to 9. We have to do this conversion
* here as AfterLoadVehicles can check it indirectly via the newgrf
* code . */
if ( IsSavegameVersionBefore ( SLV_139 ) ) {
for ( Station * st : Station : : Iterate ( ) ) {
if ( st - > airport . tile ! = INVALID_TILE & & st - > airport . type = = 15 ) {
st - > airport . type = AT_OILRIG ;
}
}
}
if ( SlXvIsFeaturePresent ( XSLFI_SPRINGPP ) ) {
if ( SlXvIsFeaturePresent ( XSLFI_SPRINGPP ) ) {
/*
/*
* Reject huge airports
* Reject huge airports
@ -1061,8 +1050,8 @@ bool AfterLoadGame()
extern void AnalyseHouseSpriteGroups ( ) ;
extern void AnalyseHouseSpriteGroups ( ) ;
AnalyseHouseSpriteGroups ( ) ;
AnalyseHouseSpriteGroups ( ) ;
/* Update all vehicles */
/* Update all vehicles : Phase 1 */
AfterLoadVehicles ( true ) ;
AfterLoadVehicles Phase1 ( true ) ;
CargoPacket : : PostVehiclesAfterLoad ( ) ;
CargoPacket : : PostVehiclesAfterLoad ( ) ;
@ -1747,11 +1736,6 @@ bool AfterLoadGame()
SetSecondaryRailType ( t , GetRailType ( t ) ) ;
SetSecondaryRailType ( t , GetRailType ( t ) ) ;
}
}
}
}
for ( Train * v : Train : : IterateFrontOnly ( ) ) {
if ( v - > IsFrontEngine ( ) | | v - > IsFreeWagon ( ) ) v - > ConsistChanged ( CCF_TRACK ) ;
}
}
}
/* In version 16.1 of the savegame a company can decide if trains, which get
/* In version 16.1 of the savegame a company can decide if trains, which get
@ -1900,7 +1884,7 @@ bool AfterLoadGame()
* preference of a user , let elrails enabled ; it can be disabled manually */
* preference of a user , let elrails enabled ; it can be disabled manually */
if ( IsSavegameVersionBefore ( SLV_38 ) ) _settings_game . vehicle . disable_elrails = false ;
if ( IsSavegameVersionBefore ( SLV_38 ) ) _settings_game . vehicle . disable_elrails = false ;
/* do the same as when elrails were enabled/disabled manually just now */
/* do the same as when elrails were enabled/disabled manually just now */
SettingsDisableElrail ( _settings_game . vehicle . disable_elrails ) ;
UpdateDisableElrailSettingState ( _settings_game . vehicle . disable_elrails , false ) ;
InitializeRailGUI ( ) ;
InitializeRailGUI ( ) ;
/* From version 53, the map array was changed for house tiles to allow
/* From version 53, the map array was changed for house tiles to allow
@ -2872,6 +2856,14 @@ bool AfterLoadGame()
}
}
}
}
if ( IsSavegameVersionBefore ( SLV_139 ) ) {
for ( Station * st : Station : : Iterate ( ) ) {
if ( st - > airport . tile ! = INVALID_TILE & & st - > airport . type = = 15 ) {
st - > airport . type = AT_OILRIG ;
}
}
}
if ( IsSavegameVersionBefore ( SLV_140 ) ) {
if ( IsSavegameVersionBefore ( SLV_140 ) ) {
for ( Station * st : Station : : Iterate ( ) ) {
for ( Station * st : Station : : Iterate ( ) ) {
if ( st - > airport . tile ! = INVALID_TILE ) {
if ( st - > airport . tile ! = INVALID_TILE ) {
@ -3469,6 +3461,14 @@ bool AfterLoadGame()
}
}
}
}
/* Beyond this point, tile types which can be accessed by vehicles must be in a valid state. */
/* Update all vehicles: Phase 2 */
AfterLoadVehiclesPhase2 ( true ) ;
/* The center of train vehicles was changed, fix up spacing. */
if ( IsSavegameVersionBefore ( SLV_164 ) ) FixupTrainLengths ( ) ;
/* In version 2.2 of the savegame, we have new airports, so status of all aircraft is reset.
/* 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 */
* This has to be called after all map array updates */
if ( IsSavegameVersionBefore ( SLV_2 , 2 ) ) UpdateOldAircraft ( ) ;
if ( IsSavegameVersionBefore ( SLV_2 , 2 ) ) UpdateOldAircraft ( ) ;
@ -4580,7 +4580,8 @@ void ReloadNewGRFData()
AnalyseIndustryTileSpriteGroups ( ) ;
AnalyseIndustryTileSpriteGroups ( ) ;
extern void AnalyseHouseSpriteGroups ( ) ;
extern void AnalyseHouseSpriteGroups ( ) ;
AnalyseHouseSpriteGroups ( ) ;
AnalyseHouseSpriteGroups ( ) ;
AfterLoadVehicles ( false ) ;
AfterLoadVehiclesPhase1 ( false ) ;
AfterLoadVehiclesPhase2 ( false ) ;
StartupEngines ( ) ;
StartupEngines ( ) ;
GroupStatistics : : UpdateAfterLoad ( ) ;
GroupStatistics : : UpdateAfterLoad ( ) ;
/* update station graphics */
/* update station graphics */