Remove now redundant Actor.IsDead checks from mission scripts

This commit is contained in:
Oliver Brakmann
2014-06-03 20:04:02 +02:00
parent 3a2bb75e01
commit 89b25c10d6
3 changed files with 11 additions and 23 deletions

View File

@@ -43,10 +43,8 @@ end
BuildNod1 = function()
Production.BuildTeamFromTemplate(nod, Nod1Template, function(team)
Team.Do(team, function(actor)
if not Actor.IsDead(actor) then
Actor.OnIdle(actor, Actor.Hunt)
Actor.OnKilled(actor, KillCounter)
end
Actor.OnIdle(actor, Actor.Hunt)
Actor.OnKilled(actor, KillCounter)
end)
Team.AddEventHandler(team.OnAllKilled, BuildNod1)
end)
@@ -55,10 +53,8 @@ end
BuildAuto1 = function()
Production.BuildTeamFromTemplate(nod, Auto1Template, function(team)
Team.Do(team, function(actor)
if not Actor.IsDead(actor) then
Actor.OnIdle(actor, Actor.Hunt)
Actor.OnKilled(actor, KillCounter)
end
Actor.OnIdle(actor, Actor.Hunt)
Actor.OnKilled(actor, KillCounter)
end)
end)
end

View File

@@ -38,11 +38,7 @@ end
Build = function(template, repeats, func)
Production.BuildTeamFromTemplate(nod, template, function(team)
Team.Do(team, function(actor)
if not Actor.IsDead(actor) then
func(actor)
end
end)
Team.Do(team, func)
if repeats then
Team.AddEventHandler(team.OnAllKilled, function()
Build(template, repeats, func)