Fixed mess up

This commit is contained in:
Alessandro Proto 2023-01-08 19:09:51 +01:00
parent 9d978fd9ab
commit 0f4acff113
3 changed files with 4 additions and 4 deletions

View file

@ -19,13 +19,13 @@ public static class Utils
long i = 1; long i = 1;
foreach (var item in iterable) foreach (var item in iterable)
{ {
L.PushObject(item); L.PushValue(item);
L.RawSetInteger(-2, i++); L.RawSetInteger(-2, i++);
} }
L.SetTop(-1); L.SetTop(-1);
} }
#nullable enable #nullable enable
public static int PushObject(this Lua L, object? obj) public static int PushValue(this Lua L, object? obj)
{ {
var type = obj?.GetType(); var type = obj?.GetType();
switch (obj) switch (obj)

View file

@ -450,7 +450,7 @@ public class FileSystem : IPlugin
foreach (var attribute in attributes) foreach (var attribute in attributes)
{ {
L.PushString(attribute.Key); L.PushString(attribute.Key);
Extensions.Utils.PushObject(L, attribute.Value); L.PushValue(attribute.Value);
L.SetTable(-3); L.SetTable(-3);
} }

View file

@ -124,7 +124,7 @@ public class Runtime
{ {
foreach (var par in ev.Parameters) foreach (var par in ev.Parameters)
{ {
Thread.PushObject(par); Thread.PushValue(par);
} }
} }
return (ev.Parameters?.Length ?? 0) + 1; return (ev.Parameters?.Length ?? 0) + 1;