Fix lua failing to translate strings with arguments
This commit is contained in:
@@ -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<string, object>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user