diff --git a/lua/SimUtils.lua b/lua/SimUtils.lua index 854d2e10c3..aa44caf84c 100644 --- a/lua/SimUtils.lua +++ b/lua/SimUtils.lua @@ -931,6 +931,14 @@ function KillArmyOnDelayedRecall(self, shareOption, shareTime) if not table.empty(sharedCommanders) then -- create a countdown to show when the ACU recalls (similar to the one used for timed self-destruct) for _, com in sharedCommanders do + -- don't recall shared ACUs + if com.RecallingAfterDefeat then + sharedCommanders[i] = nil + continue + end + -- The shared ACUs don't count as keeping the army in the game since they will eventually be removed from the game. + -- see MatchState.lua CollectDefeatedBrains + com.RecallingAfterDefeat = true StartCountdown(com.EntityId, math.floor((shareTime - GetGameTick())/10)) end diff --git a/lua/sim/MatchState.lua b/lua/sim/MatchState.lua index ed51975a8d..228cb52fa6 100644 --- a/lua/sim/MatchState.lua +++ b/lua/sim/MatchState.lua @@ -41,7 +41,7 @@ local function CollectDefeatedBrains(aliveBrains, condition, delay) -- critical units found, make sure they all exist properly local oneCriticalUnitAlive = false for _, unit in criticalUnits do - if (not IsDestroyed(unit)) and (unit:GetFractionComplete() == 1) then + if (not IsDestroyed(unit)) and (unit:GetFractionComplete() == 1) and not unit.RecallingAfterDefeat then oneCriticalUnitAlive = true break end