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 } }