Fixes (by Ocular): Grenade Launchers didn't cost any Ready AP.

Underbarrel launchers shouldn't be able to change Ready AP of primary weapon because of AP micromanagement exploits.
http://www.ja-galaxy-forum.com/ubbthreads.php/topics/336777/[PATCH]_Fix_ready_AP_cost_and_#Post336777


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7584 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-10-18 11:20:56 +00:00
parent f9cad94471
commit 03e6f0bb0b
2 changed files with 15 additions and 5 deletions
+9 -1
View File
@@ -4470,13 +4470,21 @@ BOOLEAN CheckForImproperFireGunEnd( SOLDIERTYPE *pSoldier )
//dnl ch72 260913
OBJECTTYPE *pObjHand;
BOOLEAN outOfAmmo;
if(pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO)
pObjHand = FindAttachment_GrenadeLauncher(&pSoldier->inv[HANDPOS]);
else
pObjHand = pSoldier->GetUsedWeapon(&pSoldier->inv[HANDPOS]);
// Extracted from EnoughAmmo() to avoid double calculation of pObjHand
if (Item[ pObjHand->usItem ].usItemClass & IC_LAUNCHER)
outOfAmmo = (FindAttachmentByClass( pObjHand, IC_GRENADE ) == NULL && FindAttachmentByClass( pObjHand, IC_BOMB ) == NULL);
else
outOfAmmo = (*pObjHand)[0]->data.gun.ubGunShotsLeft == 0;
// Check single hand for jammed status, ( or ammo is out.. )
if ( (*pObjHand)[0]->data.gun.bGunAmmoStatus < 0 || (*pObjHand)[0]->data.gun.ubGunShotsLeft == 0 )
if ( (*pObjHand)[0]->data.gun.bGunAmmoStatus < 0 || outOfAmmo )
{
// If we have 2 pistols, donot go back!
if ( Item[ pSoldier->inv[ SECONDHANDPOS ].usItem ].usItemClass != IC_GUN )