diff --git a/src/lua_rds.c b/src/lua_rds.c index 7eb3597..85052b5 100644 --- a/src/lua_rds.c +++ b/src/lua_rds.c @@ -92,24 +92,24 @@ uint8_t init_lua(RDSEncoder* _enc) { lua_setfield(globalL, -2, "searchers"); lua_pop(globalL, 1); - lua_newtable(L); - lua_newtable(L); - lua_setfield(L, -2, "on_init"); - lua_newtable(L); - lua_setfield(L, -2, "on_start"); - lua_newtable(L); - lua_setfield(L, -2, "on_state"); - lua_newtable(L); - lua_setfield(L, -2, "tick"); - lua_newtable(L); - lua_setfield(L, -2, "minute_tick"); - lua_newtable(L); - lua_setfield(L, -2, "rt_transmission"); - lua_newtable(L); - lua_setfield(L, -2, "ps_transmission"); - lua_pushvalue(L, -1); + lua_newtable(globalL); + lua_newtable(globalL); + lua_setfield(globalL, -2, "on_init"); + lua_newtable(globalL); + lua_setfield(globalL, -2, "on_start"); + lua_newtable(globalL); + lua_setfield(globalL, -2, "on_state"); + lua_newtable(globalL); + lua_setfield(globalL, -2, "tick"); + lua_newtable(globalL); + lua_setfield(globalL, -2, "minute_tick"); + lua_newtable(globalL); + lua_setfield(globalL, -2, "rt_transmission"); + lua_newtable(globalL); + lua_setfield(globalL, -2, "ps_transmission"); + lua_pushvalue(globalL, -1); hooks_ref = luaL_ref(globalL, LUA_REGISTRYINDEX); - lua_getglobal(L, "hooks"); + lua_getglobal(globalL, "hooks"); lua_newtable(globalL); lua_setglobal(globalL, "ext");