mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
+6
-4
@@ -3356,9 +3356,11 @@ INT16 GetAPsToReadyWeapon( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
UINT16 usItem;
|
||||
UINT8 ubReadyAPs = 0;
|
||||
|
||||
if(pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO)//dnl ch72 250913
|
||||
// Don't check the ready APs of an attached underbarrel launcher; the cost of raising a weapon
|
||||
// should not change with firing mode as it creates an unfun opportunity for micro-optimization
|
||||
/*if(pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO)//dnl ch72 250913
|
||||
usItem = GetAttachedGrenadeLauncher(&pSoldier->inv[HANDPOS]);
|
||||
else
|
||||
else*/
|
||||
usItem = pSoldier->inv[HANDPOS].usItem;
|
||||
|
||||
// If this is a dwel pistol anim
|
||||
@@ -3399,8 +3401,8 @@ INT16 GetAPsToReadyWeapon( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
}
|
||||
else
|
||||
{
|
||||
// CHECK FOR RIFLE
|
||||
if ( Item[ usItem ].usItemClass == IC_GUN )
|
||||
// CHECK FOR RIFLE (and grenade launchers)
|
||||
if ( Item[ usItem ].usItemClass & (IC_GUN | IC_LAUNCHER) )
|
||||
{
|
||||
ubReadyAPs = Weapon[ usItem ].ubReadyTime;
|
||||
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user