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:
ChrisL
2011-06-06 22:28:19 +00:00
parent 42a2130043
commit 7376ffbb68
8 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -3306,7 +3306,7 @@ UINT8 WillMercAcceptCall()
BOOLEAN CanMercBeHired()
{
UINT8 i,j;
INT8 bMercID;
UINT8 bMercID;
BOOLEAN fRetVal = FALSE;
BOOLEAN fBuddyOnTeam=FALSE;
+4 -4
View File
@@ -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);
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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));
+3 -3
View File
@@ -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 ;
+4 -4
View File
@@ -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;
+2 -2
View File
@@ -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;
+6 -6
View File
@@ -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;