Replaced every use of lua_call with RunScriptOnStack. Modified RunScriptOnStack to report an error to log and system message using a passed in context string. Modified every use of RunScriptOnStack to avoid crashing so that the reported error can be seen.

This commit is contained in:
Kyzentun
2014-07-05 01:34:05 -06:00
committed by Jonathan Payne
parent cd1292dd18
commit 95fe1a17e9
18 changed files with 219 additions and 168 deletions
+2 -5
View File
@@ -337,11 +337,8 @@ bool Screen::PassInputToLua(const InputEventPlus& input)
{
callback->second.PushSelf(L);
lua_pushvalue(L, -2);
RString error;
if(!LuaHelpers::RunScriptOnStack(L, error, 1, 1))
{
LOG->Warn("Error running input callback: %s", error.c_str());
}
RString error= "Error running input callback: ";
LuaHelpers::RunScriptOnStack(L, error, 1, 1, true);
handled= lua_toboolean(L, -1);
lua_pop(L, 1);
}