Fix IO type and mode not working well
@@ -68,7 +68,7 @@ public static class LuaFileOpenModeExtensions
"w+b" => LuaFileOpenMode.WriteUpdate,
"a+" => LuaFileOpenMode.AppendUpdate,
"a+b" => LuaFileOpenMode.AppendUpdate,
- _ => 0
+ _ => (LuaFileOpenMode)(-1)
};
}
@@ -191,7 +191,7 @@ public sealed class IOLibrary
if (arg0.TryRead<FileHandle>(out var file))
{
- return new(context.Return(file.IsOpen ? " file" : "closed file"));
+ return new(context.Return(file.IsOpen ? "file" : "closed file"));
else