From 3391c6d7773fe3bb9f6bf18934b221d0f36b8466 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Sun, 11 Aug 2024 13:30:49 +0300 Subject: [PATCH] Ignore mercs away on minievents for food status updates (#322) --- Tactical/Food.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tactical/Food.cpp b/Tactical/Food.cpp index 968c8132..0b656d49 100644 --- a/Tactical/Food.cpp +++ b/Tactical/Food.cpp @@ -364,7 +364,9 @@ void ReduceBPRegenForHunger( SOLDIERTYPE *pSoldier, INT32 *psPoints ) void HourlyFoodSituationUpdate( SOLDIERTYPE *pSoldier ) { - if ( !pSoldier ) + // A merc away on a minievent assignment is ignored since we cannot control their food or water intake. + // Without this they would end up losing stats and/or dying during long event assignments, which would lead to the game crashing when death occurs. + if ( !pSoldier || pSoldier->bAssignment == ASSIGNMENT_MINIEVENT) return; // determine our current activity level