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)
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