From 3a2bb75e01f9941522564826d859eac383e0f62e Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Tue, 3 Jun 2014 20:02:55 +0200 Subject: [PATCH] Check team members' health in Team.Do function --- mods/common/lua/team.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/common/lua/team.lua b/mods/common/lua/team.lua index 909b430137..863e904019 100644 --- a/mods/common/lua/team.lua +++ b/mods/common/lua/team.lua @@ -57,7 +57,11 @@ Team.Contains = function(team, actor) end Team.Do = function(team, func) - Utils.Do(team.Actors, func) + Utils.Do(team.Actors, function(actor) + if not Actor.IsDead(actor) then + func(actor) + end + end) end Team.Patrol = function(team, waypoints, wait, loop)