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
+3 -3
View File
@@ -183,9 +183,9 @@ void MenuTimer::SetText( float fSeconds )
LuaHelpers::Push( L, fSeconds );
// call function with 1 argument and 1 result
RString sError;
if( !LuaHelpers::RunScriptOnStack(L, sError, 1, 1) )
LOG->Warn( "Error running Text%iFormatFunction: %s", i+1, sError.c_str() );
RString Error= "Error running Text" + (i+1);
Error+= "FormatFunction: ";
LuaHelpers::RunScriptOnStack(L, Error, 1, 1, true);
RString sText;
LuaHelpers::Pop( L, sText );