Merge pull request #11095 from Mailaender/lua-getactors

Added Player.GetActors to the Lua API
This commit is contained in:
abcdefg30
2016-04-10 21:32:03 +02:00

View File

@@ -59,7 +59,13 @@ namespace OpenRA.Mods.Common.Scripting
public bool IsNonCombatant { get { return Player.NonCombatant; } }
[Desc("Returns true if the player is the local player.")]
public bool IsLocalPlayer { get { return Player == (Player.World.RenderPlayer ?? Player.World.LocalPlayer); } }
public bool IsLocalPlayer { get { return Player == (Player.World.RenderPlayer ?? Player.World.LocalPlayer); } }
[Desc("Returns all living actors staying inside the world for this player.")]
public Actor[] GetActors()
{
return Player.World.Actors.Where(actor => actor.Owner == Player && !actor.IsDead && actor.IsInWorld).ToArray();
}
[Desc("Returns an array of actors representing all ground attack units of this player.")]
public Actor[] GetGroundAttackers()