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
+2 -2
View File
@@ -797,9 +797,9 @@ INT16 DynamicAdjustAPConstants(INT16 iniReadValue, INT16 iniDefaultValue, BOOLEA
if(iniReadValue == iniDefaultValue)
{
if(!reverse)
iniReadValue = (INT16)(((FLOAT)iniReadValue*(FLOAT)APBPConstants[AP_MAXIMUM]/100)+.5);
iniReadValue = (INT16)(((FLOAT)iniReadValue*(FLOAT)APBPConstants[AP_MAXIMUM]/100)+(iniReadValue<0?-.5:.5));
else
iniReadValue = (INT16)(((FLOAT)iniReadValue/(FLOAT)APBPConstants[AP_MAXIMUM]*100)+.5);
iniReadValue = (INT16)(((FLOAT)iniReadValue/(FLOAT)APBPConstants[AP_MAXIMUM]*100)+(iniReadValue<0?-.5:.5));
}
return iniReadValue;