From a189c56cdfc9de14f5a6e0a7add663301aa687e2 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sat, 20 Jun 2026 14:11:37 +0200 Subject: [PATCH] fix rds --- src/lua_rds.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lua_rds.c b/src/lua_rds.c index a9bb449..a6499a2 100644 --- a/src/lua_rds.c +++ b/src/lua_rds.c @@ -122,8 +122,12 @@ uint8_t init_lua(RDSEncoder* _enc) { lua_pushinteger(globalL, EONs); lua_setfield(globalL, -2, "eon_count"); - lua_registertotable(globalL, "__index", lua_rds__index); - lua_registertotable(globalL, "__newindex", lua_rds__newindex); + lua_newtable(globalL); + lua_pushcfunction(globalL, lua_rds__index); + lua_setfield(globalL, -2, "__index"); + lua_pushcfunction(globalL, lua_rds__newindex); + lua_setfield(globalL, -2, "__newindex"); + lua_setmetatable(globalL, -2); lua_registertotable(globalL, "set_link", lua_set_rds_link); lua_registertotable(globalL, "get_link", lua_get_rds_link);