mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
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:
@@ -1775,7 +1775,10 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
|||||||
|
|
||||||
for (int i=0; i<TOTAL_SOLDIERS; i++)
|
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 &&
|
if( gubNumCreaturesAttackingTown && !gbWorldSectorZ &&
|
||||||
@@ -1814,7 +1817,10 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
|||||||
|
|
||||||
for (int i=0; i<TOTAL_SOLDIERS; i++)
|
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 );
|
return( TRUE );
|
||||||
|
|||||||
@@ -1016,7 +1016,10 @@ SOLDIERTYPE *ChangeSoldierTeam( SOLDIERTYPE *pSoldier, UINT8 ubTeam )
|
|||||||
{
|
{
|
||||||
pNewSoldier->inv[cnt] = pSoldier->inv[cnt];
|
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++ )
|
for(cnt = BIGPOCKSTART; cnt < pNewSoldier->inv.size(); cnt++ )
|
||||||
{
|
{
|
||||||
if(pSoldier->inv[cnt].exists() == true)
|
if(pSoldier->inv[cnt].exists() == true)
|
||||||
|
|||||||
Reference in New Issue
Block a user