diff --git a/GameVersion.h b/GameVersion.h index a39730d0..46194d34 100644 --- a/GameVersion.h +++ b/GameVersion.h @@ -21,6 +21,7 @@ extern CHAR16 zTrackingNumber[16]; // Keeps track of the saved game version. Increment the saved game version whenever // you will invalidate the saved game file +#define ASD_INIT_FIX 168 // Flugente: fix for ASD feature introduced with ENEMY_HELICOPTERS #define NONPROFILE_MERCHANTS 167 // Flugente: merchants can be created from non-profile NPCs #define INDIVIDUAL_MILITIA 166 // Flugente: individual militia #define ENEMY_JEEPS 165 // Flugente: enemy jeeps @@ -86,7 +87,7 @@ extern CHAR16 zTrackingNumber[16]; #define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes #define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system -#define SAVE_GAME_VERSION NONPROFILE_MERCHANTS +#define SAVE_GAME_VERSION ASD_INIT_FIX //#define RUSSIANGOLD #ifdef __cplusplus diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index 84c08871..46578a63 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -6158,6 +6158,15 @@ BOOLEAN LoadSavedGame( int ubSavedGameID ) InitASD(); } + // Flugente: in campaigns started before ENEMY_HELICOPTERS, the periodic ASD update routine was not properly initialised. To be sure, we definetly set it up here + if ( guiCurrentSaveGameVersion < ASD_INIT_FIX ) + { + // Flugente: if this a savegame from an older version where ASD didn't exist, we have to manually add the periodic event + DeleteAllStrategicEventsOfType( EVENT_ASD_UPDATE ); + + AddPeriodStrategicEvent( EVENT_ASD_UPDATE, 90, 0 ); + } + if ( guiCurrentSaveGameVersion >= INDIVIDUAL_MILITIA ) { uiRelEndPerc += 1;