From addff410229d5387e41b5c72b2b92c4b908b1b1e Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Sun, 4 Apr 2021 17:40:11 +0000 Subject: [PATCH] Build 21.04.04 Fixed savegame compatibility (by rftr). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8957 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameVersion.cpp | 4 ++-- GameVersion.h | 3 +-- Strategic/Auto Resolve.cpp | 2 -- Strategic/Campaign Types.h | 15 +++++++++------ Strategic/Strategic AI.cpp | 2 +- Strategic/Strategic Movement.h | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/GameVersion.cpp b/GameVersion.cpp index a5c58655..25d89e2d 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -55,8 +55,8 @@ #endif -CHAR8 czVersionNumber[16] = { "Build 20.10.16" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 21.04.04" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; -CHAR16 zRevisionNumber[16] = { L"Revision 8900" }; +CHAR16 zRevisionNumber[16] = { L"Revision 8957" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/GameVersion.h b/GameVersion.h index e20e7887..4fa11cd9 100644 --- a/GameVersion.h +++ b/GameVersion.h @@ -22,7 +22,6 @@ extern CHAR16 zRevisionNumber[16]; // Keeps track of the saved game version. Increment the saved game version whenever // you will invalidate the saved game file -#define ENEMY_ROBOTS 183 // rftr: enemy robots #define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us #define DISABILITYFLAGMASK 181 // Flugente: disabilities get a flagmask #define PROFILETYPE_STORED 180 // Flugente: the type of each profile is stored in the savegame @@ -103,7 +102,7 @@ extern CHAR16 zRevisionNumber[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 ENEMY_ROBOTS +#define SAVE_GAME_VERSION DRAGSTRUCTURE //#define RUSSIANGOLD #ifdef __cplusplus diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index c4b7f7ef..8e9e056f 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -74,8 +74,6 @@ #include "MilitiaIndividual.h" // added by Flugente #endif -#pragma optimize("",off) - #include "Reinforcement.h" //#define INVULNERABILITY diff --git a/Strategic/Campaign Types.h b/Strategic/Campaign Types.h index bebb9ef7..6f58a2f2 100644 --- a/Strategic/Campaign Types.h +++ b/Strategic/Campaign Types.h @@ -490,9 +490,8 @@ typedef struct SECTORINFO UINT8 ubNumTroops; //the actual number of troops here. UINT8 ubNumElites; //the actual number of elites here. UINT8 ubNumAdmins; //the actual number of admins here. - UINT8 ubNumRobots; //the actual number of robots here. UINT8 ubNumCreatures; //only set when immediately before ground attack made! - UINT8 ubTroopsInBattle, ubElitesInBattle, ubAdminsInBattle, ubRobotsInBattle, ubCreaturesInBattle; + UINT8 ubTroopsInBattle, ubElitesInBattle, ubAdminsInBattle, ubCreaturesInBattle; INT8 bLastKnownEnemies; // -1 means never been there, no idea, otherwise it's what we'd observed most recently // while this is being maintained (partially, surely buggy), nothing uses it anymore. ARM @@ -577,7 +576,9 @@ typedef struct SECTORINFO UINT8 ubNumElites_Turncoat; UINT8 usExplorationProgress; - INT8 bPadding[ 8 ]; + UINT8 ubNumRobots; + UINT8 ubRobotsInBattle; + INT8 bPadding[ 6 ]; }SECTORINFO; @@ -592,7 +593,7 @@ typedef struct UNDERGROUND_SECTORINFO { UINT32 uiFlags; UINT8 ubSectorX, ubSectorY, ubSectorZ; - UINT8 ubNumRobots, ubNumElites, ubNumTroops, ubNumAdmins, ubNumCreatures; + UINT8 ubNumElites, ubNumTroops, ubNumAdmins, ubNumCreatures; UINT8 fVisited; INT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating, //the more people go near it. A travel rating of 0 means there are never people @@ -603,7 +604,7 @@ typedef struct UNDERGROUND_SECTORINFO UINT8 ubNumBloodcats; // Bloodcat population UINT8 ubCreatureHabitat; //determines how creatures live in this sector (see creature spreading.c) - UINT8 ubRobotsInBattle, ubElitesInBattle, ubTroopsInBattle, ubAdminsInBattle, ubCreaturesInBattle; + UINT8 ubElitesInBattle, ubTroopsInBattle, ubAdminsInBattle, ubCreaturesInBattle; // adding these (should not change struct layout due to padding) UINT8 ubMusicMode, ubUnsed; @@ -626,8 +627,10 @@ typedef struct UNDERGROUND_SECTORINFO UINT8 ubNumJeeps; UINT8 ubJeepsInBattle; UINT8 usExplorationProgress; + UINT8 ubNumRobots; + UINT8 ubRobotsInBattle; - INT8 bPadding[12]; + INT8 bPadding[10]; //no padding left! }UNDERGROUND_SECTORINFO; diff --git a/Strategic/Strategic AI.cpp b/Strategic/Strategic AI.cpp index 5ea4a00a..28982e53 100644 --- a/Strategic/Strategic AI.cpp +++ b/Strategic/Strategic AI.cpp @@ -1907,7 +1907,7 @@ void HandlePlayerGroupNoticedByGarrison( GROUP *pPlayerGroup, UINT8 ubSectorID ) usOffensePoints = pSector->ubNumAdmins * 2 + pSector->ubNumTroops * 4 + pSector->ubNumElites * 6 + - pSector->ubNumElites * 15 + + pSector->ubNumRobots * 15 + pSector->ubNumTanks * 20 + pSector->ubNumJeeps * 12; if( PlayerForceTooStrong( ubSectorID, usOffensePoints, &usDefencePoints ) ) diff --git a/Strategic/Strategic Movement.h b/Strategic/Strategic Movement.h index e5fef61a..d8bdfacd 100644 --- a/Strategic/Strategic Movement.h +++ b/Strategic/Strategic Movement.h @@ -64,14 +64,12 @@ typedef struct ENEMYGROUP UINT8 ubNumTroops; //number of regular troops in the group UINT8 ubNumElites; //number of elite troops in the group UINT8 ubNumAdmins; //number of administrators in the group - UINT8 ubNumRobots; //number of enemy robots in the group UINT8 ubLeaderProfileID; //could be Mike, maybe the warden... someone new, but likely nobody. UINT8 ubPendingReinforcements;//This group is waiting for reinforcements before attacking or attempting to fortify newly aquired sector. UINT8 ubAdminsInBattle; //number of administrators in currently in battle. UINT8 ubIntention; //the type of group this is: patrol, assault, spies, etc. UINT8 ubTroopsInBattle; //number of soldiers currently in battle. UINT8 ubElitesInBattle; //number of elite soldiers currently in battle. - UINT8 ubRobotsInBattle; //number of enemy robots currently in battle. // WDS - New AI UINT8 ubNumTanks; UINT8 ubTanksInBattle; @@ -82,9 +80,11 @@ typedef struct ENEMYGROUP UINT8 ubNumAdmins_Turncoat; UINT8 ubNumTroops_Turncoat; UINT8 ubNumElites_Turncoat; - UINT8 bPadding_1; - INT8 bPadding[12]; + UINT8 ubNumRobots; //number of enemy robots in the group + UINT8 ubRobotsInBattle; //number of enemy robots currently in battle. + + INT8 bPadding[11]; }ENEMYGROUP; //NOTE: ALL FLAGS ARE CLEARED WHENEVER A GROUP ARRIVES IN A SECTOR, OR ITS WAYPOINTS ARE