- /* want a global or a registry value? */
- int pseudo_index;
- if (lua_equal(L, 1, LUA_REGISTRYINDEX)) {
- /* registry */
- pseudo_index = LUA_REGISTRYINDEX;
+ /* get the father */
+ lua_State* maestro = sglua_get_maestro(); /* maestro: */
+
+ /* want a global or a registry value?
+ get the value from maestro */
+ if (lua_compare(L, 1, LUA_REGISTRYINDEX, LUA_OPEQ)) {
+ /* case: registry */
+ lua_getfield(maestro, LUA_REGISTRYINDEX, key); /* maestro: ... value */