From 0f4acff1133cb43947c07b2a6aaefa3658cb4a92 Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Sun, 8 Jan 2023 19:09:51 +0100 Subject: [PATCH] Fixed mess up --- Capy64/LuaRuntime/Extensions/Utils.cs | 4 ++-- Capy64/LuaRuntime/Libraries/FileSystem.cs | 2 +- Capy64/LuaRuntime/Runtime.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Capy64/LuaRuntime/Extensions/Utils.cs b/Capy64/LuaRuntime/Extensions/Utils.cs index 612e92a..bd34702 100644 --- a/Capy64/LuaRuntime/Extensions/Utils.cs +++ b/Capy64/LuaRuntime/Extensions/Utils.cs @@ -19,13 +19,13 @@ public static class Utils long i = 1; foreach (var item in iterable) { - L.PushObject(item); + L.PushValue(item); L.RawSetInteger(-2, i++); } L.SetTop(-1); } #nullable enable - public static int PushObject(this Lua L, object? obj) + public static int PushValue(this Lua L, object? obj) { var type = obj?.GetType(); switch (obj) diff --git a/Capy64/LuaRuntime/Libraries/FileSystem.cs b/Capy64/LuaRuntime/Libraries/FileSystem.cs index 658824e..84adf3c 100644 --- a/Capy64/LuaRuntime/Libraries/FileSystem.cs +++ b/Capy64/LuaRuntime/Libraries/FileSystem.cs @@ -450,7 +450,7 @@ public class FileSystem : IPlugin foreach (var attribute in attributes) { L.PushString(attribute.Key); - Extensions.Utils.PushObject(L, attribute.Value); + L.PushValue(attribute.Value); L.SetTable(-3); } diff --git a/Capy64/LuaRuntime/Runtime.cs b/Capy64/LuaRuntime/Runtime.cs index e7f4bc8..b60932c 100644 --- a/Capy64/LuaRuntime/Runtime.cs +++ b/Capy64/LuaRuntime/Runtime.cs @@ -124,7 +124,7 @@ public class Runtime { foreach (var par in ev.Parameters) { - Thread.PushObject(par); + Thread.PushValue(par); } } return (ev.Parameters?.Length ?? 0) + 1;