From 770971142fa0ec85185956b5007d8cd9639d52e2 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Fri, 1 May 2026 12:26:17 +0200 Subject: [PATCH] - [FIX] Crida a Lua es diferent si deshabilitem el debug --- source/mini/lua/lua.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/source/mini/lua/lua.cpp b/source/mini/lua/lua.cpp index 5d6abec..b014d81 100644 --- a/source/mini/lua/lua.cpp +++ b/source/mini/lua/lua.cpp @@ -157,7 +157,15 @@ namespace mini lua_getglobal(L, "mini"); lua_getfield(L, -1, "init"); - is_playing = debug::call_and_handle_exceptions(L); + #if defined(DEBUG) && defined(__linux__) + is_playing = debug::call_and_handle_exceptions(L); + #else + if (lua_pcall(L, 0, 0, 0)) { + log_msg(LOG_LUART, "%s\n", lua_tostring(L, -1)); + lua_pop(L,1); + is_playing = false; + } + #endif } void update() { @@ -165,7 +173,15 @@ namespace mini lua_getglobal(L, "mini"); lua_getfield(L, -1, "update"); - is_playing = debug::call_and_handle_exceptions(L); + #if defined(DEBUG) && defined(__linux__) + is_playing = debug::call_and_handle_exceptions(L); + #else + if (lua_pcall(L, 0, 0, 0)) { + log_msg(LOG_LUART, "%s\n", lua_tostring(L, -1)); + lua_pop(L,1); + is_playing = false; + } + #endif } }