Bugfix that removes a rare CTD that can occur if a non-LBE item accidentally gets associated with a merc.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2077 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-04-25 18:17:53 +00:00
parent b4b31cdb06
commit e2ad50963b
+5 -1
View File
@@ -3624,7 +3624,11 @@ BOOLEAN ChangeDropPackStatus(SOLDIERTYPE *pSoldier, BOOLEAN newStatus)
{
for(unsigned int wi = 0; wi < guiNumWorldItems; wi++)
{
if(gWorldItems[wi].soldierID == pSoldier->ubID && gWorldItems[wi].object.exists() == true && LoadBearingEquipment[Item[gWorldItems[wi].object.usItem].ubClassIndex].lbeClass == BACKPACK)
//CHRISL: There's the remote chance that a non-LBE item might get associated with a merc. If that happens, we can
// have a CTD, so lets resolve that here.
if(Item[gWorldItems[wi].object.usItem].usItemClass != IC_LBEGEAR)
gWorldItems[wi].soldierID = -1;
if(gWorldItems[wi].soldierID == pSoldier->ubID && gWorldItems[wi].object.exists() == true && Item[gWorldItems[wi].object.usItem].usItemClass == IC_LBEGEAR && LoadBearingEquipment[Item[gWorldItems[wi].object.usItem].ubClassIndex].lbeClass == BACKPACK)
{
for (int x = 0; x < gWorldItems[wi].object.ubNumberOfObjects; ++x) {
// Is the item we dropped in this sector and does it have an active LBENODE flag?