From 329b1cd878b83037c83bf2a640ad022e1e5fb555 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 14 Apr 2013 22:09:27 +0000 Subject: [PATCH] Fix: savegame compatibility git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6004 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameVersion.h | 3 ++- Tactical/Soldier Control.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/GameVersion.h b/GameVersion.h index 58872c49..209ca387 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 MODULARIZED_AI 140 // Flugente: new savegame version due to modularized AI #define MILITIA_EQUIPMENT 139 // Flugente: militia can equip from sector inventory #define MULTITURN_ACTIONS 138 // Flugente: multiturn actions #define EXTERNALISED_MERCHANTS 137 // Flugente: increased the number of merchants and externalised their data @@ -58,7 +59,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 MILITIA_EQUIPMENT +#define SAVE_GAME_VERSION MODULARIZED_AI //#define RUSSIANGOLD #ifdef __cplusplus diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index ed1b14dc..1827706d 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -1272,7 +1272,8 @@ public: INT16 bAIIndex; // PlanFactory from the modularized tactical AI that shall be used // Flugente: Decrease this filler by 1 for each new UINT8 / BOOLEAN variable, so we can maintain savegame compatibility!! - UINT8 ubFiller[11]; + // Note that we also have to account for padding, so you might need to substract more than just the size of the new variables + UINT8 ubFiller[10]; #ifdef JA2UB //ja25