/// <summary> /// Push a debug.traceback reference onto the stack, for a pcall function to use as error handler. (Remember to increment any top-of-stack markers!) /// </summary> private static int PushDebugTraceback(LuaState luaState, int argCount) { luaState.GetGlobal("debug"); luaState.GetField(-1, "traceback"); luaState.Remove(-2); int errindex = -argCount - 2; luaState.Insert(errindex); return(errindex); }