From 422c72b95719799b774f664948620f10d1cf7422 Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Thu, 6 May 2021 18:38:31 +0000 Subject: [PATCH] Fixes NPCs going back to cower animation after collapsing which also caused them not to die properly (by Shadooow). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9006 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Ani.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index 797edb8b..62c32322 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -4895,22 +4895,30 @@ BOOLEAN OKFallDirection( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT BOOLEAN HandleCheckForDeathCommonCode( SOLDIERTYPE *pSoldier ) { - // Do we have a primary pending animation? - if ( pSoldier->usPendingAnimation2 != NO_PENDING_ANIMATION ) + //shadooow: fix for going back to cower animation after collapsing + if (pSoldier->CheckForBreathCollapse() || pSoldier->bCollapsed) { - pSoldier->ChangeSoldierState( pSoldier->usPendingAnimation2, 0, FALSE ); - pSoldier->usPendingAnimation2 = NO_PENDING_ANIMATION; - return( TRUE ); - } - - // CHECK IF WE HAVE A PENDING ANIMATION HERE - if ( pSoldier->usPendingAnimation != NO_PENDING_ANIMATION ) - { - pSoldier->ChangeSoldierState( pSoldier->usPendingAnimation, 0, FALSE ); pSoldier->usPendingAnimation = NO_PENDING_ANIMATION; - return( TRUE ); + pSoldier->usPendingAnimation2 = NO_PENDING_ANIMATION; } + else + { + // Do we have a primary pending animation? + if (pSoldier->usPendingAnimation2 != NO_PENDING_ANIMATION) + { + pSoldier->ChangeSoldierState(pSoldier->usPendingAnimation2, 0, FALSE); + pSoldier->usPendingAnimation2 = NO_PENDING_ANIMATION; + return(TRUE); + } + // CHECK IF WE HAVE A PENDING ANIMATION HERE + if (pSoldier->usPendingAnimation != NO_PENDING_ANIMATION) + { + pSoldier->ChangeSoldierState(pSoldier->usPendingAnimation, 0, FALSE); + pSoldier->usPendingAnimation = NO_PENDING_ANIMATION; + return(TRUE); + } + } // OTHERWISE, GOTO APPROPRIATE STOPANIMATION! pSoldier->bCollapsed = TRUE;