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:
+2
-3
@@ -1154,9 +1154,8 @@ void Actor::RunCommands( const LuaReference& cmds, const LuaReference *pParamTab
|
||||
pParamTable->PushSelf( L );
|
||||
|
||||
// call function with 2 arguments and 0 results
|
||||
RString sError;
|
||||
if( !LuaHelpers::RunScriptOnStack(L, sError, 2, 0) )
|
||||
LOG->Warn( "Error playing command: %s", sError.c_str() );
|
||||
RString Error= "Error playing command: ";
|
||||
LuaHelpers::RunScriptOnStack(L, Error, 2, 0, true);
|
||||
|
||||
LUA->Release(L);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user