From a3cb1f39efc8312da4d9b321193377b6b1b48d6d Mon Sep 17 00:00:00 2001 From: MaddMugsy Date: Sun, 28 May 2006 16:37:26 +0000 Subject: [PATCH] make sure enemies only use legal ammo types git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@126 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Items.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 61eabb1a..459cb0a5 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -4454,7 +4454,7 @@ UINT16 RandomMagazine( UINT16 usItem, UINT8 ubPercentStandard ) while ( Magazine[ usLoop ].ubCalibre != NOAMMO ) { if (Magazine[usLoop].ubCalibre == pWeapon->ubCalibre && - Magazine[usLoop].ubMagSize == pWeapon->ubMagSize) + Magazine[usLoop].ubMagSize == pWeapon->ubMagSize && ItemIsLegal(MagazineClassIndexToItemType(usLoop))) { // store it! (make sure array is big enough) Assert(usPossibleMagCnt < MAX_AMMO_TYPES_PER_GUN); @@ -4536,7 +4536,7 @@ UINT16 RandomMagazine( OBJECTTYPE * pGun, UINT8 ubPercentStandard ) while ( Magazine[ usLoop ].ubCalibre != NOAMMO ) { if (Magazine[usLoop].ubCalibre == pWeapon->ubCalibre && - Magazine[usLoop].ubMagSize == GetMagSize(pGun)) + Magazine[usLoop].ubMagSize == GetMagSize(pGun) && ItemIsLegal(MagazineClassIndexToItemType(usLoop))) { // store it! (make sure array is big enough) Assert(usPossibleMagCnt < MAX_AMMO_TYPES_PER_GUN);