Add an IsDead check to prevent crashes in survival01

This commit is contained in:
abcdefg30
2016-07-18 18:55:21 +02:00
parent 00c6260ec2
commit 308a1a72b3

View File

@@ -66,20 +66,22 @@ SovietBuildings = { Barrack1, SubPen, RadarDome, AdvancedPowerPlant1, AdvancedPo
IdleTrigger = function(units, dest) IdleTrigger = function(units, dest)
Utils.Do(units, function(unit) Utils.Do(units, function(unit)
Trigger.OnIdle(unit, function() if not unit.IsDead then
local bool = Utils.All(units, function(unit) return unit.IsIdle end) Trigger.OnIdle(unit, function()
if bool then local bool = Utils.All(units, function(unit) return unit.IsIdle end)
if bool then
SetupHuntTrigger(units)
end
end)
Trigger.OnDamaged(unit, function()
SetupHuntTrigger(units) SetupHuntTrigger(units)
end end)
end)
Trigger.OnDamaged(unit, function() Trigger.OnCapture(unit, function()
SetupHuntTrigger(units) Trigger.ClearAll(unit)
end) end)
end
Trigger.OnCapture(unit, function()
Trigger.ClearAll(unit)
end)
end) end)
end end