From 75e9ab3883762da08cc24d3a2d65ca9fe6558067 Mon Sep 17 00:00:00 2001 From: silversurfer Date: Sun, 24 Aug 2014 11:23:15 +0000 Subject: [PATCH] Bugfix: This should finally fix the deadlock that could happen when someone was running through a letal gas cloud and died in it. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7405 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 39d3aee4..60b8d477 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -9693,6 +9693,14 @@ void HandleTakeDamageDeath( SOLDIERTYPE *pSoldier, UINT8 bOldLife, UINT8 ubReaso pSoldier->flags.fInNonintAnim = FALSE; } + // silversurfer: fix for the deadlock that could happen when the victim was running through a gas cloud that lead to his death. + // If he is near death the next check will make him collapse. If he is really dead then he won't move anywhere anyway + // so it should be safe to stop him here. + if ( pSoldier->stats.bLife < OKLIFE && !pSoldier->bCollapsed ) + { + pSoldier->EVENT_StopMerc( pSoldier->sGridNo, pSoldier->ubDirection ); + } + // Check for < OKLIFE if ( pSoldier->stats.bLife < OKLIFE && pSoldier->stats.bLife != 0 && !pSoldier->bCollapsed ) {