Skip to content

Commit b40179b

Browse files
committed
Some rework for 5c01f45
1 parent 741031c commit b40179b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/xrScriptEngine/script_engine.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,9 @@ struct raii_guard : private Noncopyable
524524
#ifdef DEBUG
525525
static const bool break_on_assert = !!strstr(Core.Params, "-break_on_assert");
526526
#else
527-
static const bool break_on_assert = false; // xxx: true will hide real lua error, LuaJIT problem?
527+
static const bool break_on_assert = true; // xxx: there is no point to set it true\false in Release, since game will crash anyway in most cases due to XRAY_EXCEPTIONS disabled in Release build.
528528
#endif
529-
if (!m_error_code) return;
529+
if (!m_error_code) return; // xxx: Check "lua_pcall_failed" before changing this!
530530
if (break_on_assert)
531531
R_ASSERT2(!m_error_code, m_error_description);
532532
else
@@ -754,7 +754,12 @@ void CScriptEngine::lua_error(lua_State* L)
754754

755755
int CScriptEngine::lua_pcall_failed(lua_State* L)
756756
{
757-
print_output(L, "", LUA_ERRRUN);
757+
#if (!defined(DEBUG) && !XRAY_EXCEPTIONS)
758+
print_output(L, "", 0); // xxx: Force game to not break in raii_guard() for this type of errors
759+
#else
760+
print_output(L, "", LUA_ERRRUN); // xxx: Default behavior
761+
#endif
762+
758763
on_error(L);
759764

760765
#ifndef DEBUG // Debug already do it

0 commit comments

Comments
 (0)