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 -1
View File
@@ -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);
}