mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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
This commit is contained in:
+20
-12
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user