From 14113159bdb6361e053968f0aa73594051816110 Mon Sep 17 00:00:00 2001 From: Flugente Date: Fri, 8 Mar 2013 20:09:36 +0000 Subject: [PATCH] Fix: NO_STANDING_ANIM_ADJUSTMENT_IN_COMBAT worked on all animations, which caused explosion victims to not update anims correctly. As a fix, we check for individual animations git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5908 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Overhead.cpp | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 6a74c8288..29ad2f322 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -1703,13 +1703,43 @@ BOOLEAN ExecuteOverhead( ) { // 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 ) + if ( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT && gGameExternalOptions.fNoStandingAnimAdjustInCombat && !pSoldier->bCollapsed && !pSoldier->bBreathCollapsed ) { - pSoldier->AdjustNoAPToFinishMove( TRUE ); + // Flugente: We have to decide depending on the animation we have, otherwise we canc ause bugs if we do this after being hit by an explosion etc. + BOOLEAN dontadjustanim = FALSE; + switch ( pSoldier->usAnimState ) + { + case WALKING: + case CROUCHING: + case SWATTING: + case RUNNING: + case CRAWLING: + case END_HURT_WALKING: + case SWAT_BACKWARDS: + case SWATTING_WK: + case SWAT_BACKWARDS_WK: + case SWAT_BACKWARDS_NOTHING: + case RUNNING_W_PISTOL: + case SIDE_STEP_WEAPON_RDY: + case SIDE_STEP_DUAL_RDY: + case WALKING_WEAPON_RDY: + case WALKING_DUAL_RDY: + case WALKING_ALTERNATIVE_RDY: + case SIDE_STEP_ALTERNATIVE_RDY: + dontadjustanim = TRUE; + break; + } - pSoldier->usPendingAnimation = NO_PENDING_ANIMATION; - pSoldier->ubPendingDirection = NO_PENDING_DIRECTION; - pSoldier->aiData.ubPendingAction = NO_PENDING_ACTION; + if ( dontadjustanim ) + { + pSoldier->AdjustNoAPToFinishMove( TRUE ); + + pSoldier->usPendingAnimation = NO_PENDING_ANIMATION; + pSoldier->ubPendingDirection = NO_PENDING_DIRECTION; + pSoldier->aiData.ubPendingAction = NO_PENDING_ACTION; + } + else + pSoldier->SoldierGotoStationaryStance( ); } else pSoldier->SoldierGotoStationaryStance( );