mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
BUGFIX 491 - Recast variables related to the Buddy/Hated system so that proper UINT8 values (0-255) are allowed.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4480 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3306,7 +3306,7 @@ UINT8 WillMercAcceptCall()
|
||||
BOOLEAN CanMercBeHired()
|
||||
{
|
||||
UINT8 i,j;
|
||||
INT8 bMercID;
|
||||
UINT8 bMercID;
|
||||
BOOLEAN fRetVal = FALSE;
|
||||
BOOLEAN fBuddyOnTeam=FALSE;
|
||||
|
||||
|
||||
+4
-4
@@ -1203,7 +1203,7 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bEvolution, sizeof(this->bEvolution), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->ubMiscFlags, sizeof(this->ubMiscFlags), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bSexist, sizeof(this->bSexist), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bLearnToHate, sizeof(this->bLearnToHate), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bLearnToHate, sizeof(this->bLearnToHate), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bStealRate, sizeof(this->bStealRate), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bVocalVolume, sizeof(this->bVocalVolume), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->ubQuoteRecord, sizeof(this->ubQuoteRecord), sizeof(UINT8), numBytesRead);
|
||||
@@ -1281,8 +1281,8 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
||||
numBytesRead += 28;
|
||||
}
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bLeadership, sizeof(this->bLeadership), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, this->bBuddy, sizeof(this->bBuddy), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, this->bHated, sizeof(this->bHated), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, this->bBuddy, sizeof(this->bBuddy), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, this->bHated, sizeof(this->bHated), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bExpLevel, sizeof(this->bExpLevel), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bMarksmanship, sizeof(this->bMarksmanship), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bMinService, sizeof(this->bMinService), sizeof(UINT8), numBytesRead);
|
||||
@@ -1325,7 +1325,7 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
||||
if(guiCurrentSaveGameVersion < STOMP12_SAVEGAME_DATATYPE_CHANGE)
|
||||
ReadFieldByField( hFile, &filler, sizeof(UINT8), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->sMedicalDepositAmount, sizeof(this->sMedicalDepositAmount), sizeof(UINT16), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bLearnToLike, sizeof(this->bLearnToLike), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bLearnToLike, sizeof(this->bLearnToLike), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, this->ubApproachVal, sizeof(this->ubApproachVal), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, this->ubApproachMod, sizeof(this->ubApproachMod), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bTown, sizeof(this->bTown), sizeof(INT8), numBytesRead);
|
||||
|
||||
@@ -481,7 +481,7 @@ BOOLEAN MercContractHandling( SOLDIERTYPE *pSoldier, UINT8 ubDesiredAction )
|
||||
BOOLEAN WillMercRenew( SOLDIERTYPE *pSoldier, BOOLEAN fSayQuote )
|
||||
{
|
||||
UINT8 i;
|
||||
INT8 bMercID;
|
||||
UINT8 bMercID;
|
||||
BOOLEAN fBuddyAround = FALSE;
|
||||
BOOLEAN fUnhappy = FALSE;
|
||||
UINT16 usBuddyQuote=0;
|
||||
|
||||
@@ -1229,8 +1229,8 @@ MERCPROFILESTRUCT& MERCPROFILESTRUCT::operator=(const OLD_MERCPROFILESTRUCT_101&
|
||||
memcpy( &(this->SKIN), &(src.SKIN), sizeof(PaletteRepID) ); // 30
|
||||
memcpy( &(this->HAIR), &(src.HAIR), sizeof(PaletteRepID) ); // 30
|
||||
|
||||
memcpy( &(this->bBuddy), &(src.bBuddy), 5 * sizeof (INT8));
|
||||
memcpy( &(this->bHated), &(src.bHated), 5 * sizeof (INT8));
|
||||
memcpy( &(this->bBuddy), &(src.bBuddy), 5 * sizeof (UINT8));
|
||||
memcpy( &(this->bHated), &(src.bHated), 5 * sizeof (UINT8));
|
||||
memcpy( &(this->ubRoomRangeStart), &(src.ubRoomRangeStart), 2 * sizeof (UINT8));
|
||||
memcpy( &(this->bMercTownReputation), &(src.bMercTownReputation), 20 * sizeof (INT8));
|
||||
memcpy( &(this->usApproachFactor), &(src.usApproachFactor), 4 * sizeof (UINT16));
|
||||
|
||||
@@ -1939,7 +1939,7 @@ void UpdateSoldierPointerDataIntoProfile( BOOLEAN fPlayerMercs )
|
||||
BOOLEAN DoesMercHaveABuddyOnTheTeam( UINT8 ubMercID )
|
||||
{
|
||||
UINT8 ubCnt;
|
||||
INT8 bBuddyID;
|
||||
UINT8 bBuddyID;
|
||||
|
||||
// loop through the list of people the merc is buddies with
|
||||
for(ubCnt=0; ubCnt< 3; ubCnt++)
|
||||
@@ -2344,11 +2344,11 @@ void OverwriteMercProfileWithXMLData( UINT32 uiLoop )
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
memcpy( &(gMercProfiles[ uiLoop ].bBuddy), &(tempProfiles[ uiLoop ].bBuddy), 5 * sizeof (INT8));
|
||||
memcpy( &(gMercProfiles[ uiLoop ].bBuddy), &(tempProfiles[ uiLoop ].bBuddy), 5 * sizeof (UINT8));
|
||||
gMercProfiles[ uiLoop ].bLearnToLike = tempProfiles[ uiLoop ].bLearnToLike ;
|
||||
gMercProfiles[ uiLoop ].bLearnToLikeTime = tempProfiles[ uiLoop ].bLearnToLikeTime ;
|
||||
|
||||
memcpy( &(gMercProfiles[ uiLoop ].bHated), &(tempProfiles[ uiLoop ].bHated), 5 * sizeof (INT8));
|
||||
memcpy( &(gMercProfiles[ uiLoop ].bHated), &(tempProfiles[ uiLoop ].bHated), 5 * sizeof (UINT8));
|
||||
memcpy( &(gMercProfiles[ uiLoop ].bHatedTime), &(tempProfiles[ uiLoop ].bHatedTime), 5 * sizeof (INT8));
|
||||
gMercProfiles[ uiLoop ].bLearnToHate = tempProfiles[ uiLoop ].bLearnToHate ;
|
||||
gMercProfiles[ uiLoop ].bLearnToHateTime = tempProfiles[ uiLoop ].bLearnToHateTime ;
|
||||
|
||||
@@ -347,13 +347,13 @@ typedef struct
|
||||
INT8 bNewSkillTrait29;
|
||||
INT8 bNewSkillTrait30;
|
||||
|
||||
INT8 bBuddy[5];
|
||||
INT8 bLearnToLike;
|
||||
UINT8 bBuddy[5];
|
||||
UINT8 bLearnToLike;
|
||||
INT8 bLearnToLikeTime;
|
||||
|
||||
INT8 bHated[5];
|
||||
UINT8 bHated[5];
|
||||
INT8 bHatedTime[5];
|
||||
INT8 bLearnToHate;
|
||||
UINT8 bLearnToHate;
|
||||
INT8 bLearnToHateTime;
|
||||
|
||||
INT16 sSalary;
|
||||
|
||||
@@ -308,11 +308,11 @@ profileEndElementHandle(void *userData, const XML_Char *name)
|
||||
tempProfiles[pData->curIndex].bNewSkillTrait30 = pData->curProfile.bNewSkillTrait30;
|
||||
|
||||
|
||||
memcpy( &(tempProfiles[pData->curIndex].bBuddy), &(pData->curProfile.bBuddy), 5 * sizeof (INT8));
|
||||
memcpy( &(tempProfiles[pData->curIndex].bBuddy), &(pData->curProfile.bBuddy), 5 * sizeof (UINT8));
|
||||
tempProfiles[pData->curIndex].bLearnToLike = pData->curProfile.bLearnToLike;
|
||||
tempProfiles[pData->curIndex].bLearnToLikeTime = pData->curProfile.bLearnToLikeTime;
|
||||
|
||||
memcpy( &(tempProfiles[pData->curIndex].bHated), &(pData->curProfile.bHated), 5 * sizeof (INT8));
|
||||
memcpy( &(tempProfiles[pData->curIndex].bHated), &(pData->curProfile.bHated), 5 * sizeof (UINT8));
|
||||
memcpy( &(tempProfiles[pData->curIndex].bHatedTime), &(pData->curProfile.bHatedTime), 5 * sizeof (INT8));
|
||||
tempProfiles[pData->curIndex].bLearnToHate = pData->curProfile.bLearnToHate;
|
||||
tempProfiles[pData->curIndex].bLearnToHateTime = pData->curProfile.bLearnToHateTime;
|
||||
|
||||
@@ -369,7 +369,7 @@ public:
|
||||
INT8 bEvolution;
|
||||
UINT8 ubMiscFlags;
|
||||
UINT8 bSexist;
|
||||
INT8 bLearnToHate;
|
||||
UINT8 bLearnToHate;
|
||||
|
||||
// skills
|
||||
INT8 bStealRate;
|
||||
@@ -499,7 +499,7 @@ public:
|
||||
INT8 bBaseMorale;
|
||||
UINT16 sMedicalDepositAmount;
|
||||
|
||||
INT8 bLearnToLike;
|
||||
UINT8 bLearnToLike;
|
||||
UINT8 ubApproachVal[4];
|
||||
UINT8 ubApproachMod[3][4];
|
||||
INT8 bTown;
|
||||
@@ -612,7 +612,7 @@ public:
|
||||
INT8 bEvolution;
|
||||
UINT8 ubMiscFlags;
|
||||
UINT8 bSexist;
|
||||
INT8 bLearnToHate;
|
||||
UINT8 bLearnToHate;
|
||||
|
||||
// skills
|
||||
INT8 bStealRate;
|
||||
@@ -693,8 +693,8 @@ public:
|
||||
//INT8 bSkillTrait3; // added by SANDRO
|
||||
INT8 bLeadership;
|
||||
|
||||
INT8 bBuddy[5];
|
||||
INT8 bHated[5];
|
||||
UINT8 bBuddy[5];
|
||||
UINT8 bHated[5];
|
||||
INT8 bExpLevel; // general experience level
|
||||
|
||||
INT8 bMarksmanship;
|
||||
@@ -744,7 +744,7 @@ public:
|
||||
INT8 bBaseMorale;
|
||||
UINT16 sMedicalDepositAmount;
|
||||
|
||||
INT8 bLearnToLike;
|
||||
UINT8 bLearnToLike;
|
||||
UINT8 ubApproachVal[4];
|
||||
UINT8 ubApproachMod[3][4];
|
||||
INT8 bTown;
|
||||
|
||||
Reference in New Issue
Block a user