mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fix: Equipping militia with guns and ammo could lead to creation of ammo items with 0 bullets.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7518 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4660,7 +4660,12 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
(*pObj)[i]->data.ubShotsLeft -= takeammo;
|
||||
|
||||
if ( !(*pObj)[i]->data.ubShotsLeft )
|
||||
pWorldItem[ uiCount ].object.MoveThisObjectTo(gTempObject, 1 );
|
||||
{
|
||||
pWorldItem[uiCount].object.RemoveObjectAtIndex( i );
|
||||
|
||||
// we removed an item from the stack - set back the loop variable so we don't miss an object
|
||||
--i;
|
||||
}
|
||||
}
|
||||
|
||||
if ( pWorldItem[ uiCount ].object.ubNumberOfObjects < 1 )
|
||||
@@ -4668,7 +4673,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
if ( pWorldItem[ uiCount ].sGridNo != NOWHERE )
|
||||
RemoveItemFromPool(pWorldItem[ uiCount ].sGridNo, uiCount, pWorldItem[ uiCount ].ubLevel);
|
||||
|
||||
pWorldItem[ uiCount ].fExists = FALSE;
|
||||
pWorldItem[uiCount].fExists = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4700,7 +4705,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
if ( pWorldItem[ uiCount ].sGridNo != NOWHERE )
|
||||
RemoveItemFromPool(pWorldItem[ uiCount ].sGridNo, uiCount, pWorldItem[ uiCount ].ubLevel);
|
||||
|
||||
pWorldItem[ uiCount ].fExists = FALSE;
|
||||
pWorldItem[uiCount].fExists = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user