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) {