mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Bugfix for JaggZilla Bug #625
There was a check missing if the item we look at is really an ammo item. Other item classes can have class indexes too... git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6537 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2245,7 +2245,8 @@ void addAmmoToPocketPopup( SOLDIERTYPE *pSoldier, INT16 sPocket, POPUP* popup ){
|
||||
for(UINT16 i = 0; i < pInventoryPoolList.size(); i++)
|
||||
{ // TODO: index ammo crates in sector, don't loop over entire inventory for each mag/gun
|
||||
|
||||
if( Magazine[ Item[pInventoryPoolList[i].object.usItem].ubClassIndex ].ubMagType >= AMMO_BOX // item is ammo box/crate
|
||||
if( Item[ pInventoryPoolList[i].object.usItem ].usItemClass == IC_AMMO // really looking at ammo? Class indexes also exist for other item classes!
|
||||
&& Magazine[ Item[pInventoryPoolList[i].object.usItem].ubClassIndex ].ubMagType >= AMMO_BOX // item is ammo box/crate
|
||||
&& Magazine[ Item[pInventoryPoolList[i].object.usItem].ubClassIndex ].ubAmmoType // same ammo type
|
||||
== Magazine[ Item[loop].ubClassIndex ].ubAmmoType // as the mag we found?
|
||||
&& Magazine[ Item[pInventoryPoolList[i].object.usItem].ubClassIndex ].ubCalibre // same calibre
|
||||
|
||||
Reference in New Issue
Block a user