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
This commit is contained in:
MaddMugsy
2006-05-28 16:37:26 +00:00
parent b9bd4cda26
commit a3cb1f39ef
+2 -2
View File
@@ -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);