From 98c18495c6599783afb5c5494569b50d046d3b27 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:58:16 +0200 Subject: [PATCH] Update GENERAL_SAVE_INFO::sContractRehireSoldierID to SoldierID --- Ja2/SaveLoadGame.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Ja2/SaveLoadGame.cpp b/Ja2/SaveLoadGame.cpp index 3d6344413..ab84c4498 100644 --- a/Ja2/SaveLoadGame.cpp +++ b/Ja2/SaveLoadGame.cpp @@ -296,12 +296,12 @@ typedef struct - BOOLEAN fSkyriderEmptyHelpGiven; - BOOLEAN fEnterMapDueToContract; + BOOLEAN fSkyriderEmptyHelpGiven; + BOOLEAN fEnterMapDueToContract; UINT8 ubHelicopterHitsTaken; UINT8 ubQuitType; - BOOLEAN fSkyriderSaidCongratsOnTakingSAM; - INT16 sContractRehireSoldierID; + BOOLEAN fSkyriderSaidCongratsOnTakingSAM; + SoldierID sContractRehireSoldierID; GAME_OPTIONS GameOptions; @@ -8505,7 +8505,7 @@ BOOLEAN SaveGeneralInfo( HWFILE hFile ) if( pContractReHireSoldier != NULL ) sGeneralInfo.sContractRehireSoldierID = pContractReHireSoldier->ubID; else - sGeneralInfo.sContractRehireSoldierID = -1; + sGeneralInfo.sContractRehireSoldierID = NOBODY; memcpy( &sGeneralInfo.GameOptions, &gGameOptions, sizeof( GAME_OPTIONS ) ); #ifndef BMP_RANDOM//dnl ch55 111009 @@ -8784,7 +8784,7 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile ) numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubHelicopterHitsTaken, sizeof(sGeneralInfo.ubHelicopterHitsTaken), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubQuitType, sizeof(sGeneralInfo.ubQuitType), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fSkyriderSaidCongratsOnTakingSAM, sizeof(sGeneralInfo.fSkyriderSaidCongratsOnTakingSAM), sizeof(BOOLEAN), numBytesRead); - numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sContractRehireSoldierID, sizeof(sGeneralInfo.sContractRehireSoldierID), sizeof(INT16), numBytesRead); + numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sContractRehireSoldierID, sizeof(sGeneralInfo.sContractRehireSoldierID), sizeof(UINT16), numBytesRead); numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.GameOptions, sizeof(sGeneralInfo.GameOptions), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiSeedNumber, sizeof(sGeneralInfo.uiSeedNumber), sizeof(UINT32), numBytesRead); numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiBaseJA2Clock, sizeof(sGeneralInfo.uiBaseJA2Clock), sizeof(UINT32), numBytesRead); @@ -9045,10 +9045,10 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile ) ubQuitType = sGeneralInfo.ubQuitType; //if the soldier id is valid - if( sGeneralInfo.sContractRehireSoldierID == -1 ) + if( sGeneralInfo.sContractRehireSoldierID == NOBODY ) pContractReHireSoldier = NULL; else - pContractReHireSoldier = &Menptr[ sGeneralInfo.sContractRehireSoldierID ]; + pContractReHireSoldier = sGeneralInfo.sContractRehireSoldierID; memcpy( &gGameOptions, &sGeneralInfo.GameOptions, sizeof( GAME_OPTIONS ) ); #ifndef BMP_RANDOM//dnl ch55 111009