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