nvm, it was luaL_dofile that behaved like a retard all along...

This commit is contained in:
abux 2026-07-27 09:58:38 +01:00
parent 71ed95d2ba
commit 961db3295b

View file

@ -42,7 +42,7 @@ pub fn exec(self: *Self, comptime ReturnType: type, code: []const u8) !ReturnTyp
/// ----------------------------------------------------
/// ----------------------------------------------------
pub fn execFromFile(self: *Self, comptime ReturnType: type, path: [*:0]const u8) !ReturnType {
if (lua.luaL_dofile(self.state, path) != 0) {
if (lua.luaL_dofile(self.state, path)) {
return self.luaError();
}
if (ReturnType == void) return {};
@ -375,8 +375,8 @@ test "exec" {
zl.register("spawnEntity", spawnEntity);
// --- EXEC FILE ---
try zl.exec(void, @embedFile("scripts/basic.lua"));
// try zl.execFromFile(void, "src/scripts/basic.lua");
// try zl.exec(void, @embedFile("scripts/basic.lua"));
try zl.execFromFile(void, "src/scripts/basic.lua");
// --- CALL ---
try zl.call(void, "hello", .{"World"});