diff --git a/OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs index 98f9583407..71384d39c3 100644 --- a/OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs @@ -21,10 +21,13 @@ namespace OpenRA.Mods.Common.Scripting public class MapGlobal : ScriptGlobal { readonly SpawnMapActors sma; + readonly World world; + public MapGlobal(ScriptContext context) : base(context) { sma = context.World.WorldActor.Trait(); + world = context.World; // Register map actors as globals (yuck!) foreach (var kv in sma.Actors) @@ -133,5 +136,8 @@ namespace OpenRA.Mods.Common.Scripting { return Context.World.ActorsHavingTrait(t => t.HasTag(tag)).ToArray(); } + + [Desc("Returns a table of all the actors that are currently on the map/in the world.")] + public Actor[] ActorsInWorld { get { return world.Actors.ToArray(); } } } }