new feature: 'Move item' assignment allows quick and easy mass transfer of items between city sectors.

Warning: GameDir >= r1723 is required.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6280 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-08-11 15:22:29 +00:00
parent fd8b146296
commit 8171fdbe7e
22 changed files with 1045 additions and 45 deletions
+11 -3
View File
@@ -2045,15 +2045,17 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
if ( guiCurrentSaveGameVersion >= SOLDIER_PROFILES )
{
numBytesRead = ReadFieldByField(hFile, &this->usSoldierProfile, sizeof(usSoldierProfile), sizeof(UINT16), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &this->usItemMoveSectorID, sizeof(usItemMoveSectorID), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &this->ubFiller, sizeof(ubFiller), sizeof(UINT8), numBytesRead);
}
else
{
this->usSoldierProfile = 0;
this->usItemMoveSectorID = 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(usSoldierProfile);
const UINT8 tmp = sizeof(usSoldierProfile) + sizeof(usItemMoveSectorID);
UINT8 blarg[tmp];
numBytesRead = ReadFieldByField(hFile, &blarg, tmp, sizeof(UINT8), numBytesRead);
@@ -2067,10 +2069,11 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
this->usMultiTurnAction = 0;
this->bAIIndex = 0;
this->usSoldierProfile = 0;
this->usItemMoveSectorID = 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
// +1 for padding
const UINT8 tmp = sizeof(bOverTurnAPS) + sizeof(this->sMTActionGridNo) + sizeof(usMultiTurnAction) + sizeof(bAIIndex) + 1 + sizeof(usSoldierProfile);
const UINT8 tmp = sizeof(bOverTurnAPS) + sizeof(this->sMTActionGridNo) + sizeof(usMultiTurnAction) + sizeof(bAIIndex) + 1 + sizeof(usSoldierProfile) + sizeof(usItemMoveSectorID);
UINT8 blarg[tmp];
numBytesRead = ReadFieldByField(hFile, &blarg, tmp, sizeof(UINT8), numBytesRead);
@@ -2125,6 +2128,11 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
while((buffer%4) > 0)
buffer++;
for(int i = 0; i < sizeof(usItemMoveSectorID); ++i)
buffer++;
while((buffer%4) > 0)
buffer++;
for(int i = 0; i < sizeof(ubFiller); ++i)
buffer++;
while((buffer%4) > 0)