From 8feea0111e9bc7ed4a45d20681ba967d0b61894e Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Fri, 28 Mar 2025 14:33:40 +1000 Subject: [PATCH] deal with gCamera being exposed incorrectly --- src/pc/lua/smlua_cobject.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/pc/lua/smlua_cobject.c b/src/pc/lua/smlua_cobject.c index c825a0f33..f8b6a0a32 100644 --- a/src/pc/lua/smlua_cobject.c +++ b/src/pc/lua/smlua_cobject.c @@ -724,17 +724,9 @@ void smlua_cobject_init_globals(void) { lua_setglobal(L, #ptr); \ } \ -#define EXPOSE_GLOBAL(lot, ptr) \ - { \ - smlua_push_object(L, lot, &ptr, NULL); \ - lua_setglobal(L, #ptr); \ - } \ - -#define EXPOSE_GLOBAL_WITH_NAME(lot, ptr, name) \ - { \ - smlua_push_object(L, lot, &ptr, NULL); \ - lua_setglobal(L, name); \ - } \ +#define EXPOSE_GLOBAL(lot, ptr) smlua_push_object(L, lot, &ptr, NULL); lua_setglobal(L, #ptr); +#define EXPOSE_GLOBAL_PTR(lot, ptr) smlua_push_object(L, lot, ptr, NULL); lua_setglobal(L, #ptr); +#define EXPOSE_GLOBAL_WITH_NAME(lot, ptr, name) smlua_push_object(L, lot, ptr, NULL); lua_setglobal(L, name); // Array structs @@ -763,9 +755,9 @@ void smlua_cobject_init_globals(void) { // Structs - EXPOSE_GLOBAL_WITH_NAME(LOT_GLOBALTEXTURES, gGlobalTextures, "gTextures"); + EXPOSE_GLOBAL_WITH_NAME(LOT_GLOBALTEXTURES, &gGlobalTextures, "gTextures"); - EXPOSE_GLOBAL_WITH_NAME(LOT_GLOBALOBJECTANIMATIONS, gGlobalObjectAnimations, "gObjectAnimations"); + EXPOSE_GLOBAL_WITH_NAME(LOT_GLOBALOBJECTANIMATIONS, &gGlobalObjectAnimations, "gObjectAnimations"); EXPOSE_GLOBAL(LOT_PAINTINGVALUES, gPaintingValues); @@ -783,7 +775,7 @@ void smlua_cobject_init_globals(void) { EXPOSE_GLOBAL(LOT_NAMETAGSSETTINGS, gNametagsSettings); - EXPOSE_GLOBAL(LOT_CAMERA, gCamera); + EXPOSE_GLOBAL_PTR(LOT_CAMERA, gCamera); } void smlua_cobject_init_per_file_globals(const char* path) {