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:
@@ -26,7 +26,8 @@ void LuaExpressionTransform::TransformItemDirect( Actor &a, float fPositionOffse
|
||||
LuaHelpers::Push( L, fPositionOffsetFromCenter );
|
||||
LuaHelpers::Push( L, iItemIndex );
|
||||
LuaHelpers::Push( L, iNumItems );
|
||||
lua_call( L, 4, 0 ); // 4 args, 0 results
|
||||
RString error= "Lua error in Transform function: ";
|
||||
LuaHelpers::RunScriptOnStack(L, error, 4, 0, true);
|
||||
LUA->Release(L);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user