Skip to content
Snippets Groups Projects
Commit fa25cdad authored by Golden's avatar Golden
Browse files

Fix `constants' searching SOC's vars, deny A_* and super being in `constants'.

parent ad0c684d
No related branches found
No related tags found
2 merge requests!2355fix newer versions of mixerx,!1646Expose a `constants` dictionary to Lua.
......@@ -555,10 +555,14 @@ 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)
// 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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment