diff --git a/Content.Tests/DMProject/Tests/Builtins/params2list.dm b/Content.Tests/DMProject/Tests/Builtins/params2list.dm index 835d18e572..f871acd6a3 100644 --- a/Content.Tests/DMProject/Tests/Builtins/params2list.dm +++ b/Content.Tests/DMProject/Tests/Builtins/params2list.dm @@ -3,4 +3,4 @@ ASSERT(json_encode(params2list("a;a;a")) == @#{"a":["","",""]}#) ASSERT(params2list("a=1;b=2") ~= list(a="1", b="2")) - ASSERT(params2list("a=1;a=2") ~= list(a="2")) + ASSERT(params2list("a=1;a=2")["a"] ~= list("1","2")) diff --git a/OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs b/OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs index 7e9e71c385..592a4e73d1 100644 --- a/OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs +++ b/OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs @@ -1886,9 +1886,10 @@ public static DreamList Params2List(DreamObjectTree objectTree, string queryStri } } } else { - string queryValue = queryValues[^1]; //Use the last appearance of the key in the query - - list.SetValue(new DreamValue(queryKey), new DreamValue(queryValue)); + if (queryValues.Length > 1) + list.SetValue(new DreamValue(queryKey), new DreamValue(objectTree.CreateList(queryValues))); + else + list.SetValue(new DreamValue(queryKey), new DreamValue(queryValues[0])); } }