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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user