diff --git a/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs index 50ca3e5add..b5177936cc 100644 --- a/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs @@ -93,6 +93,12 @@ namespace OpenRA.Mods.Common.Scripting return collection.Random(Context.World.SharedRandom).CopyReference(); } + [Desc("Returns the collection in a random order.")] + public LuaValue[] Shuffle(LuaValue[] collection) + { + return collection.Shuffle(Context.World.SharedRandom).ToArray(); + } + [Desc("Expands the given footprint one step along the coordinate axes, and (if requested) diagonals.")] public CPos[] ExpandFootprint(CPos[] footprint, bool allowDiagonal) {