Add an IsDead check to prevent crashes in survival01
This commit is contained in:
@@ -66,6 +66,7 @@ SovietBuildings = { Barrack1, SubPen, RadarDome, AdvancedPowerPlant1, AdvancedPo
|
|||||||
IdleTrigger = function(units, dest)
|
IdleTrigger = function(units, dest)
|
||||||
Utils.Do(units, function(unit)
|
Utils.Do(units, function(unit)
|
||||||
|
|
||||||
|
if not unit.IsDead then
|
||||||
Trigger.OnIdle(unit, function()
|
Trigger.OnIdle(unit, function()
|
||||||
local bool = Utils.All(units, function(unit) return unit.IsIdle end)
|
local bool = Utils.All(units, function(unit) return unit.IsIdle end)
|
||||||
if bool then
|
if bool then
|
||||||
@@ -80,6 +81,7 @@ IdleTrigger = function(units, dest)
|
|||||||
Trigger.OnCapture(unit, function()
|
Trigger.OnCapture(unit, function()
|
||||||
Trigger.ClearAll(unit)
|
Trigger.ClearAll(unit)
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user