New Feature: Multi-turn actions allow mercs to perform actions intended on a specific gridno over multiple turns. Currently demonstrated on the adding/removing/filling of sandbags.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5777 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-01-06 03:51:09 +00:00
parent 153f55ace8
commit 9ea7ebf393
25 changed files with 462 additions and 124 deletions
+21 -4
View File
@@ -2024,12 +2024,31 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
numBytesRead = ReadFieldByField(hFile, &this->usStarveDamageHealth, sizeof(usStarveDamageHealth), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &this->usStarveDamageStrength, sizeof(usStarveDamageStrength), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &this->ubFiller, sizeof(ubFiller), sizeof(UINT8), numBytesRead);
if ( guiCurrentSaveGameVersion >= MULTITURN_ACTIONS )
{
numBytesRead = ReadFieldByField(hFile, &this->bOverTurnAPS, sizeof(bOverTurnAPS), sizeof(INT16), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &this->sMTActionGridNo, sizeof(sMTActionGridNo), sizeof(INT32), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &this->usMultiTurnAction, sizeof(usMultiTurnAction), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &this->ubFiller, sizeof(ubFiller), sizeof(UINT8), numBytesRead);
}
else
{
this->bOverTurnAPS = 0;
this->sMTActionGridNo = NOWHERE;
this->usMultiTurnAction = 0;
// as we added new variables, fillersize was reduced, here we account for that. We have to also read the existing fillers that now do not exist anymore
const UINT8 tmp = sizeof(bOverTurnAPS) + sizeof(this->sMTActionGridNo) + sizeof(usMultiTurnAction);
UINT8 blarg[tmp];
numBytesRead = ReadFieldByField(hFile, &blarg, tmp, sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &this->ubFiller, sizeof(ubFiller), sizeof(UINT8), numBytesRead);
}
}
else
{
//CHRISL: We have to make sure we add a buffer to account for the lack of ubInterruptCounter and that buffer needs to be a full DWORD in size
buffer = 0;
for(int i = 0; i < sizeof(bFoodLevel); ++i)
buffer++;
while((buffer%4) > 0)
@@ -2054,8 +2073,6 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
buffer++;
while((buffer%4) > 0)
buffer++;
numBytesRead += buffer;
}
#ifdef JA2UB