fix lua oom errors

This commit is contained in:
Squibid 2025-12-10 22:31:18 -05:00
parent 9553e3831f
commit 1e973eff94
Signed by: squibid
GPG key ID: BECE5684D3C4005D
4 changed files with 14 additions and 23 deletions

View file

@ -39,9 +39,7 @@ pub fn add(L: *zlua.Lua) i32 {
_ = L.pushString("callback");
_ = L.getTable(2);
if (L.isFunction(-1)) {
hook.options.lua_cb_ref_idx = L.ref(zlua.registry_index) catch {
L.raiseErrorStr("Lua error check your config", .{}); // TODO: Give more descriptive error
};
hook.options.lua_cb_ref_idx = try L.ref(zlua.registry_index);
}
try server.hooks.append(gpa, hook);