From 23a8f63bd87def3d0b8d6f085ca70415943c420b Mon Sep 17 00:00:00 2001 From: ChrisL Date: Thu, 9 Apr 2009 19:25:24 +0000 Subject: [PATCH] Corretion to the 100AP/HAM integration. Also made an APBPConstant a littler clearer (hopefully). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2699 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 6 +++--- Init.h | 2 +- Tactical/Overhead.cpp | 8 ++++---- Tactical/Soldier Control.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 2aae302c5..6c96886ce 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1064,9 +1064,9 @@ void LoadGameAPBPConstants() APBPConstants[BAD_AP_COST] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BAD_AP_COST",36),36); APBPConstants[AP_RELOAD_LOOSE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_RELOAD_LOOSE",8),8); APBPConstants[AP_UNJAM] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_UNJAM",2),2); - APBPConstants[AP_MAX_SUPPRESSED] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MAX_SUPPRESSED",32),32); - APBPConstants[AP_MAX_TURN_SUPPRESSED] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MAX_TURN_SUPPRESSED",100),100); - APBPConstants[AP_MIN_LIMIT_SUPPRESSION_LOSS] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MIN_LIMIT_SUPPRESSION_LOSS",-100),-100); + APBPConstants[AP_MAX_SUPPRESSED] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MAX_SUPPRESSED",64),64); + APBPConstants[AP_MAX_TURN_SUPPRESSED] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MAX_TURN_SUPPRESSED",200),200); + APBPConstants[AP_MIN_SUPPRESSION_LIMIT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MIN_SUPPRESSION_LIMIT",-100),-100); APBPConstants[AP_LOST_PER_MORALE_DROP] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_LOST_PER_MORALE_DROP",12),12); APBPConstants[AP_SUPPRESSION_MOD] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_SUPPRESSION_MOD",24),24); APBPConstants[DEFAULT_APS] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","DEFAULT_APS",80),80); diff --git a/Init.h b/Init.h index 9cd8783f8..b330e39fc 100644 --- a/Init.h +++ b/Init.h @@ -91,7 +91,7 @@ AP_UNJAM, AP_WRONG_MAG, AP_MAX_SUPPRESSED, AP_MAX_TURN_SUPPRESSED, -AP_MIN_LIMIT_SUPPRESSION_LOSS, +AP_MIN_SUPPRESSION_LIMIT, AP_LOST_PER_MORALE_DROP, AP_SUPPRESSION_MOD, AUTOFIRE_SHOTS_AP_VALUE, diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 7ae9ab905..cb7a43cde 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -7279,9 +7279,9 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker ) // HEADROCK HAM B2: This makes sure that we never lose more APs than we're allowed per turn, if (APS_SUPPRESSED_TOTAL = TRUE) { - if (pSoldier->ubAPsLostToSuppression + ubPointsLost > APBPConstants[AP_MAX_SUPPRESSED]) + if (pSoldier->ubAPsLostToSuppression + ubPointsLost > APBPConstants[AP_MAX_TURN_SUPPRESSED]) { - ubPointsLost = APBPConstants[AP_MAX_SUPPRESSED] - pSoldier->ubAPsLostToSuppression; + ubPointsLost = APBPConstants[AP_MAX_TURN_SUPPRESSED] - pSoldier->ubAPsLostToSuppression; } } // Keeps a number for later reference @@ -7456,9 +7456,9 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker ) DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleSuppressionFire: reduce action points")); // Reduce action points! // HEADROCK HAM Beta 2.2: Enforce a minimum limit via INI. - if (pSoldier->bActionPoints - ubPointsLost < APBPConstants[AP_MIN_LIMIT_SUPPRESSION_LOSS] ) + if (pSoldier->bActionPoints - ubPointsLost < APBPConstants[AP_MIN_SUPPRESSION_LIMIT] ) { - pSoldier->bActionPoints = APBPConstants[AP_MIN_LIMIT_SUPPRESSION_LOSS]; + pSoldier->bActionPoints = APBPConstants[AP_MIN_SUPPRESSION_LIMIT]; } else { diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 800994313..febf78b3f 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -1850,8 +1850,8 @@ INT16 SOLDIERTYPE::CalcActionPoints( void ) // If resulting APs are below our permitted minimum, raise them to it! // HEADROCK: Enforce new minimums due to suppression. I should've done this neater though. - if (ubPoints < APBPConstants[AP_MIN_LIMIT_SUPPRESSION_LOSS]) - ubPoints = APBPConstants[AP_MIN_LIMIT_SUPPRESSION_LOSS]; + if (ubPoints < APBPConstants[AP_MIN_SUPPRESSION_LIMIT]) + ubPoints = APBPConstants[AP_MIN_SUPPRESSION_LIMIT]; // make sure action points doesn't exceed the permitted maximum ubMaxAPs = gubMaxActionPoints[ this->ubBodyType ];