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:
@@ -44,9 +44,8 @@ void DynamicActorScroller::LoadFromNode( const XNode *pNode )
|
||||
lua_pushnil( L );
|
||||
lua_pushnil( L );
|
||||
|
||||
RString sError;
|
||||
if( !LuaHelpers::RunScriptOnStack(L, sError, 2, 1) ) // 2 args, 1 result
|
||||
LOG->Warn( "Error running LoadFunction: %s", sError.c_str() );
|
||||
RString Error= "Error running LoadFunction: ";
|
||||
LuaHelpers::RunScriptOnStack(L, Error, 2, 1, true); // 2 args, 1 result
|
||||
|
||||
m_iNumItems = (int) luaL_checknumber( L, -1 );
|
||||
lua_pop( L, 1 );
|
||||
@@ -119,9 +118,8 @@ void DynamicActorScroller::ConfigureActor( Actor *pActor, int iItem )
|
||||
pActor->PushSelf( L );
|
||||
LuaHelpers::Push( L, iItem );
|
||||
|
||||
RString sError;
|
||||
if( !LuaHelpers::RunScriptOnStack(L, sError, 2, 0) ) // 2 args, 0 results
|
||||
LOG->Warn( "Error running LoadFunction: %s", sError.c_str() );
|
||||
RString Error= "Error running LoadFunction: ";
|
||||
LuaHelpers::RunScriptOnStack(L, Error, 2, 0, true); // 2 args, 0 results
|
||||
|
||||
LUA->Release(L);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user