From 14ec138fc7348c9cf6b0fbef22d178729c52e304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Fa=C5=82kowski?= Date: Mon, 2 Oct 2023 18:32:15 +0200 Subject: [PATCH] Fixed UI movement mode not switching to crawl on character collapse, leading to deadlocks (#231) --- Tactical/Points.cpp | 2 +- Tactical/Soldier Control.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Tactical/Points.cpp b/Tactical/Points.cpp index f16aacc8..81597a60 100644 --- a/Tactical/Points.cpp +++ b/Tactical/Points.cpp @@ -3214,7 +3214,7 @@ BOOLEAN CheckForMercContMove( SOLDIERTYPE *pSoldier ) return( FALSE ); } - if( pSoldier->stats.bLife >= OKLIFE ) + if( pSoldier->stats.bLife >= OKLIFE && !(pSoldier->bCollapsed && pSoldier->bBreath < OKBREATH) ) { if( pSoldier->sGridNo != pSoldier->pathing.sFinalDestination || pSoldier->bGoodContPath ) { diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 103ceb66..d41c63a4 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -21855,6 +21855,8 @@ void SoldierCollapse( SOLDIERTYPE *pSoldier ) pSoldier->bCollapsed = TRUE; + pSoldier->usUIMovementMode = CRAWLING; + pSoldier->ReceivingSoldierCancelServices( ); // CC has requested - handle sight here...