nvm, it was luaL_dofile that behaved like a retard all along...
This commit is contained in:
parent
71ed95d2ba
commit
961db3295b
1 changed files with 3 additions and 3 deletions
|
|
@ -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"});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue