diff --git a/OpenRA.Mods.Common/Scripting/Global/UserInterfaceGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/UserInterfaceGlobal.cs index ee10f4d643..8ae845e8d3 100644 --- a/OpenRA.Mods.Common/Scripting/Global/UserInterfaceGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/UserInterfaceGlobal.cs @@ -9,7 +9,6 @@ */ #endregion -using System.Collections.Generic; using Eluant; using OpenRA.Mods.Common.Widgets; using OpenRA.Primitives; @@ -40,7 +39,8 @@ namespace OpenRA.Mods.Common.Scripting.Global { if (args != null) { - var argumentDictionary = new Dictionary(); + var argumentDictionary = new object[args.Count * 2]; + var i = 0; foreach (var kv in args) { using (kv.Key) @@ -51,7 +51,8 @@ namespace OpenRA.Mods.Common.Scripting.Global "String arguments requires a table of [\"string\"]=value pairs. " + $"Received {kv.Key.WrappedClrType().Name},{kv.Value.WrappedClrType().Name}"); - argumentDictionary.Add(variable, value); + argumentDictionary[i++] = variable; + argumentDictionary[i++] = value; } }