Adjusted the system that dynamically adjusts AP/BP values so it would round negative numbers better.

Fixed an INT8 redefine of AP values which was causing AP values larger then 127 to become negative numbers.
Fixed an autofire glich that would allow you to empty an entire mag while using the xxx_AP_BONUS settings in the INI file.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2450 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-12-10 19:46:50 +00:00
parent 86b02ea67e
commit e21506c5a5
3 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -1093,7 +1093,8 @@ INT16 CalcAPsToAutofire( INT16 bBaseActionPoints, OBJECTTYPE * pObj, UINT8 bDoAu
aps = ( aps * ( 100 - GetPercentAutofireAPReduction(pObj) ) ) / 100;
if ( aps < 0 ) aps = 0;
else if ( aps > APBPConstants[AP_MAXIMUM] ) aps = APBPConstants[AP_MAXIMUM];
//CHRISL: This can cause problem if a player uses any of the xxx_AP_BONUS values in the INI file.
//else if ( aps > APBPConstants[AP_MAXIMUM] ) aps = APBPConstants[AP_MAXIMUM];
}
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("CalcAPsToAutoFire: return aps = %d", aps));
@@ -1240,7 +1241,7 @@ INT16 CalcTotalAPsToAttack( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTur
}
return( (INT8)sAPCost );
return( sAPCost );
}
INT16 MinAPsToAttack(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCost, UINT8 ubForceRaiseGunCost)