From 695a5013c02c043ffa1e39568b4fe7afc513f861 Mon Sep 17 00:00:00 2001 From: Flugente Date: Fri, 4 Jan 2013 21:45:01 +0000 Subject: [PATCH] if NO_STANDING_ANIM_ADJUSTMENT_IN_COMBAT is true, in turnbased combat, mercs do not automatically change animation from 'running' to 'standing' after arriving at target lcoation (same for walking etc.). This saves AP if we decide to immediately continue moving to another location. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5763 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 7 +++++-- GameSettings.h | 1 + Tactical/Overhead.cpp | 13 ++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 913e374d3..31eee59a2 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1262,8 +1262,11 @@ void LoadGameExternalOptions() gGameExternalOptions.fShotHeadDivisor = iniReader.ReadFloat("Tactical Interface Settings","SHOT_HEAD_DIVISOR",1.5,1,10); // Penalty for fire when you don't see enemy (when you see enemy because his see militya or ather merc) - gGameExternalOptions.iPenaltyShootUnSeen = iniReader.ReadInteger("Tactical Interface Settings","SHOOT_UNSEEN_PENALTY",0,0,255); - + gGameExternalOptions.iPenaltyShootUnSeen = iniReader.ReadInteger("Tactical Interface Settings","SHOOT_UNSEEN_PENALTY",0,0,255); + + // Flugente: in turnbased combat, do not adjust animation after arriving at target location + gGameExternalOptions.fNoStandingAnimAdjustInCombat = iniReader.ReadBoolean("Tactical Interface Settings","NO_STANDING_ANIM_ADJUSTMENT_IN_COMBAT", TRUE); + //Inventory AP Weight Divisor gGameExternalOptions.uWeightDivisor = iniReader.ReadFloat("Tactical Interface Settings","INV_AP_WEIGHT_DIVISOR",5,0,100); diff --git a/GameSettings.h b/GameSettings.h index 64e892cbb..b78569fe8 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -733,6 +733,7 @@ typedef struct FLOAT uShotHeadPenalty; FLOAT fShotHeadDivisor; INT16 iPenaltyShootUnSeen; + BOOLEAN fNoStandingAnimAdjustInCombat; // Flugente: in turnbased combat, do not adjust animation after arriving at target location //Inventory AP Weight Divisor FLOAT uWeightDivisor; diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 9d353fd58..913998a18 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -1701,7 +1701,18 @@ BOOLEAN ExecuteOverhead( ) if ( !fAimAfterMove ) // SANDRO - don't do this after movement with weapon raised { - pSoldier->SoldierGotoStationaryStance( ); + // Flugente: if in turnbased combat and option is selected, do not go to standing animation + // By this, we wont have to spend additional APs when we continue to run + if ( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT && gGameExternalOptions.fNoStandingAnimAdjustInCombat ) + { + pSoldier->AdjustNoAPToFinishMove( TRUE ); + + pSoldier->usPendingAnimation = NO_PENDING_ANIMATION; + pSoldier->ubPendingDirection = NO_PENDING_DIRECTION; + pSoldier->aiData.ubPendingAction = NO_PENDING_ACTION; + } + else + pSoldier->SoldierGotoStationaryStance( ); } } }