Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-19 07:45:49 +00:00

fix lua5.4 incompat

This commit is contained in:
bol-van
2025-11-25 13:26:55 +03:00
parent 6a26ea85a3
commit 5e737f314b
3 changed files with 3 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ function luaexec(ctx, desync)
end
local fname = desync.func_instance.."_luaexec_code"
if not _G[fname] then
_G[fname] = loadstring(desync.arg.code, fname)
_G[fname] = load(desync.arg.code, fname)
end
-- allow dynamic code to access desync
_G.desync = desync

View File

@@ -1039,7 +1039,7 @@ void lua_pushf_args(const struct ptr_list_head *args, int idx_desync)
else if (val[0]=='#')
{
lua_push_blob(idx_desync, val+1);
lua_Integer len = lua_objlen(params.L, -1);
lua_Integer len = lua_rawlen(params.L, -1);
lua_pop(params.L,1);
lua_pushf_int(var, len);
}

View File

@@ -36,6 +36,7 @@ void lua_do_gc(void);
#if LUA_VERSION_NUM < 502
int lua_absindex(lua_State *L, int idx);
#define lua_rawlen lua_objlen
#endif
// push - create object and push to the stack