diff options
author | madmaxoft <github@xoft.cz> | 2014-03-19 22:55:47 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-03-19 22:55:47 +0100 |
commit | 74b7f51b898575bacec52663e5e8601d6bfd36bd (patch) | |
tree | 00d4b4bccd64508d5bbb45ad2736620d34ab07cc /src/Bindings/LuaState.cpp | |
parent | APIDump: Updated comments to reflect current code. (diff) | |
download | cuberite-74b7f51b898575bacec52663e5e8601d6bfd36bd.tar cuberite-74b7f51b898575bacec52663e5e8601d6bfd36bd.tar.gz cuberite-74b7f51b898575bacec52663e5e8601d6bfd36bd.tar.bz2 cuberite-74b7f51b898575bacec52663e5e8601d6bfd36bd.tar.lz cuberite-74b7f51b898575bacec52663e5e8601d6bfd36bd.tar.xz cuberite-74b7f51b898575bacec52663e5e8601d6bfd36bd.tar.zst cuberite-74b7f51b898575bacec52663e5e8601d6bfd36bd.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/LuaState.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index f24e15c3b..0bb047873 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -1080,20 +1080,20 @@ bool cLuaState::ReportErrors(lua_State * a_LuaState, int a_Status) -void cLuaState::LogStackTrace(void) +void cLuaState::LogStackTrace(int a_StartingDepth) { - LogStackTrace(m_LuaState); + LogStackTrace(m_LuaState, a_StartingDepth); } -void cLuaState::LogStackTrace(lua_State * a_LuaState) +void cLuaState::LogStackTrace(lua_State * a_LuaState, int a_StartingDepth) { LOGWARNING("Stack trace:"); lua_Debug entry; - int depth = 0; + int depth = a_StartingDepth; while (lua_getstack(a_LuaState, depth, &entry)) { lua_getinfo(a_LuaState, "Sln", &entry); @@ -1312,7 +1312,7 @@ void cLuaState::LogStack(lua_State * a_LuaState, const char * a_Header) int cLuaState::ReportFnCallErrors(lua_State * a_LuaState) { LOGWARNING("LUA: %s", lua_tostring(a_LuaState, -1)); - LogStackTrace(a_LuaState); + LogStackTrace(a_LuaState, 1); return 1; // We left the error message on the stack as the return value } |