mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Fix constants' searching SOC's vars, deny A_* and super being in
constants'.
This commit is contained in:
parent
ad0c684d1d
commit
fa25cdad81
1 changed files with 7 additions and 3 deletions
|
@ -555,11 +555,15 @@ static int constants_get(lua_State *L)
|
|||
|
||||
key = luaL_checkstring(L, 2);
|
||||
|
||||
// In Lua, mathlib is always there
|
||||
ret = getEnum(L, true, key);
|
||||
// In Lua, mathlib is never there
|
||||
ret = getEnum(L, false, key);
|
||||
|
||||
if (ret != -1)
|
||||
return ret;
|
||||
// Don't allow A_* or super.
|
||||
// All userdata is meant to be considered global variables,
|
||||
// so no need to get more specific than "is it userdata?"
|
||||
if (!lua_isuserdata(L, -1) && !lua_isfunction(L, -1))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue