1616
1717void LuaLog (LPCSTR caMessage)
1818{
19+ if (!GlobalEnv.ScriptEngine ->m_stack_is_ready )
20+ Log (caMessage); // Xottab_DUTY: temporary workaround to get lua log output
21+
1922#ifndef MASTER_GOLD
2023 GlobalEnv.ScriptEngine ->script_log (LuaMessageType::Message, " %s" , caMessage);
2124#endif
@@ -27,6 +30,9 @@ void LuaLog(LPCSTR caMessage)
2730
2831void ErrorLog (LPCSTR caMessage)
2932{
33+ if (!GlobalEnv.ScriptEngine ->m_stack_is_ready )
34+ Log (caMessage); // Xottab_DUTY: temporary workaround to get lua error output
35+
3036 GlobalEnv.ScriptEngine ->error_log (" %s" , caMessage);
3137#ifdef DEBUG
3238 GlobalEnv.ScriptEngine ->print_stack ();
@@ -44,6 +50,13 @@ void ErrorLog(LPCSTR caMessage)
4450#endif
4551}
4652
53+ // AVO:
54+ void PrintStack ()
55+ {
56+ GlobalEnv.ScriptEngine ->print_stack ();
57+ }
58+ // -AVO
59+
4760void FlushLogs ()
4861{
4962#ifdef DEBUG
@@ -149,8 +162,8 @@ SCRIPT_EXPORT(CScriptEngine, (), {
149162 .def (" start" , &profile_timer_script::start)
150163 .def (" stop" , &profile_timer_script::stop)
151164 .def (" time" , &profile_timer_script::time),
152- def (" log" , &LuaLog), def (" error_log" , &ErrorLog), def (" flush" , &FlushLogs), def (" prefetch " , &prefetch_module ),
153- def (" verify_if_thread_is_running " , &verify_if_thread_is_running ), def (" editor " , &is_editor ),
165+ def (" log" , &LuaLog), def (" error_log" , &ErrorLog), def (" flush" , &FlushLogs), def (" print_stack " , &PrintStack ),
166+ def (" prefetch " , &prefetch_module ), def (" verify_if_thread_is_running " , &verify_if_thread_is_running ),
154167 def (" bit_and" , &bit_and), def (" bit_or" , &bit_or), def (" bit_xor" , &bit_xor), def (" bit_not" , &bit_not),
155- def (" user_name" , &user_name)];
168+ def (" editor " , &is_editor), def ( " user_name" , &user_name)];
156169});
0 commit comments