Fixed assertion error caused when switching from strategic to tactical with a dead merc in the current team.

Fixed a bug where hired RPCs would not get items stored in their gunsling or knife pockets.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2359 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-09-23 23:14:49 +00:00
parent 52a28a8268
commit 6f2af55cba
2 changed files with 12 additions and 3 deletions
+8 -2
View File
@@ -1775,7 +1775,10 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
for (int i=0; i<TOTAL_SOLDIERS; i++)
{
Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE);
//CHRISL: We should only bother with this assertion if the soldier is alive. Dead soliders are moved to
// GridNo = NOWHERE, which causes this assertion to fail
if(!(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD))
Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE );
}
if( gubNumCreaturesAttackingTown && !gbWorldSectorZ &&
@@ -1814,7 +1817,10 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
for (int i=0; i<TOTAL_SOLDIERS; i++)
{
Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE);
//CHRISL: We should only bother with this assertion if the soldier is alive. Dead soliders are moved to
// GridNo = NOWHERE, which causes this assertion to fail
if(!(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD))
Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE);
}
return( TRUE );
+4 -1
View File
@@ -1016,7 +1016,10 @@ SOLDIERTYPE *ChangeSoldierTeam( SOLDIERTYPE *pSoldier, UINT8 ubTeam )
{
pNewSoldier->inv[cnt] = pSoldier->inv[cnt];
}
// Next, try to autoplace everything else
// Next, direct copy of the gunsling and knife pockets
pNewSoldier->inv[GUNSLINGPOCKPOS] = pSoldier->inv[GUNSLINGPOCKPOS];
pNewSoldier->inv[KNIFEPOCKPOS] = pSoldier->inv[KNIFEPOCKPOS];
// Then, try to autoplace everything else
for(cnt = BIGPOCKSTART; cnt < pNewSoldier->inv.size(); cnt++ )
{
if(pSoldier->inv[cnt].exists() == true)