Fix Mercprofile usStrategicInsertionData for bigmaps

NPCs would not appear in the map if their gridno was over 65535 in large maps
This commit is contained in:
Asdow
2025-06-15 14:42:34 +03:00
parent 11caa6529c
commit efb54202ea
3 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ extern CHAR16 zBuildInformation[256];
//
// Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
#define GROWTH_MODIFIERS 184
#define REBELCOMMAND 183
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
@@ -105,7 +105,7 @@ extern CHAR16 zBuildInformation[256];
#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 GROWTH_MODIFIERS
#define SAVE_GAME_VERSION MERC_PROFILE_INSERTION_DATA
//#define RUSSIANGOLD
#ifdef __cplusplus
+10 -1
View File
@@ -1467,7 +1467,16 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
numBytesRead = ReadFieldByField( hFile, &this->ubLastDateSpokenTo, sizeof(this->ubLastDateSpokenTo), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bLastQuoteSaidWasSpecial, sizeof(this->bLastQuoteSaidWasSpecial), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bSectorZ, sizeof(this->bSectorZ), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(this->usStrategicInsertionData), sizeof(UINT16), numBytesRead);
if ( guiCurrentSaveGameVersion >= MERC_PROFILE_INSERTION_DATA )
{
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof( this->usStrategicInsertionData ), sizeof( UINT32 ), numBytesRead );
}
else
{
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(this->usStrategicInsertionData), sizeof(UINT16), numBytesRead);
}
numBytesRead = ReadFieldByField( hFile, &this->bFriendlyOrDirectDefaultResponseUsedRecently, sizeof(this->bFriendlyOrDirectDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bRecruitDefaultResponseUsedRecently, sizeof(this->bRecruitDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bThreatenDefaultResponseUsedRecently, sizeof(this->bThreatenDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
+1 -1
View File
@@ -934,7 +934,7 @@ public:
UINT8 ubLastDateSpokenTo;
UINT8 bLastQuoteSaidWasSpecial;
INT8 bSectorZ;
UINT16 usStrategicInsertionData;
UINT32 usStrategicInsertionData;
INT8 bFriendlyOrDirectDefaultResponseUsedRecently;
INT8 bRecruitDefaultResponseUsedRecently;
INT8 bThreatenDefaultResponseUsedRecently;