mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Fix: when firing from several barrels with two guns, AP cost is deducted twice
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9145 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+22
-16
@@ -2502,17 +2502,20 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
PlayWeaponSound(pSoldier, pObjHand, pObjAttHand, usUBItem);
|
||||
|
||||
// ONLY DEDUCT FOR THE FIRST HAND when doing two-pistol attacks
|
||||
if (pSoldier->IsValidSecondHandShot() && (*pObjHand)[0]->data.gun.bGunStatus >= USABLE && (*pObjHand)[0]->data.gun.bGunAmmoStatus > 0)
|
||||
if ( !pSoldier->usBarrelCounter )
|
||||
{
|
||||
// only deduct APs when the main gun fires
|
||||
if (pSoldier->ubAttackingHand == HANDPOS)
|
||||
if ( pSoldier->IsValidSecondHandShot() && ( *pObjHand )[0]->data.gun.bGunStatus >= USABLE && ( *pObjHand )[0]->data.gun.bGunAmmoStatus > 0 )
|
||||
{
|
||||
DeductPoints(pSoldier, sAPCost, iBPCost, AFTERSHOT_INTERRUPT);
|
||||
// only deduct APs when the main gun fires
|
||||
if ( pSoldier->ubAttackingHand == HANDPOS )
|
||||
{
|
||||
DeductPoints( pSoldier, sAPCost, iBPCost, AFTERSHOT_INTERRUPT );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DeductPoints( pSoldier, sAPCost, iBPCost, AFTERSHOT_INTERRUPT );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DeductPoints(pSoldier, sAPCost, iBPCost, AFTERSHOT_INTERRUPT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3220,17 +3223,20 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
PlayWeaponSound(pSoldier, pObjHand, pObjAttHand, usUBItem);
|
||||
|
||||
// ONLY DEDUCT FOR THE FIRST HAND when doing two-pistol attacks
|
||||
if (pSoldier->IsValidSecondHandShot() && (*pObjUsed)[0]->data.gun.bGunStatus >= USABLE && (*pObjUsed)[0]->data.gun.bGunAmmoStatus > 0)
|
||||
if ( !pSoldier->usBarrelCounter )
|
||||
{
|
||||
// only deduct APs when the main gun fires
|
||||
if (pSoldier->ubAttackingHand == HANDPOS)
|
||||
if ( pSoldier->IsValidSecondHandShot() && ( *pObjUsed )[0]->data.gun.bGunStatus >= USABLE && ( *pObjUsed )[0]->data.gun.bGunAmmoStatus > 0 )
|
||||
{
|
||||
DeductPoints(pSoldier, sAPCost, iBPCost, AFTERSHOT_INTERRUPT);
|
||||
// only deduct APs when the main gun fires
|
||||
if ( pSoldier->ubAttackingHand == HANDPOS )
|
||||
{
|
||||
DeductPoints( pSoldier, sAPCost, iBPCost, AFTERSHOT_INTERRUPT );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DeductPoints( pSoldier, sAPCost, iBPCost, AFTERSHOT_INTERRUPT );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DeductPoints(pSoldier, sAPCost, iBPCost, AFTERSHOT_INTERRUPT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user