summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-03-19 22:55:47 +0100
committermadmaxoft <github@xoft.cz>2014-03-19 22:55:47 +0100
commit74b7f51b898575bacec52663e5e8601d6bfd36bd (patch)
tree00d4b4bccd64508d5bbb45ad2736620d34ab07cc /src/Bindings
parentAPIDump: Updated comments to reflect current code. (diff)
downloadcuberite-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 'src/Bindings')
-rw-r--r--src/Bindings/LuaState.cpp10
-rw-r--r--src/Bindings/LuaState.h4
2 files changed, 7 insertions, 7 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
}
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index f5cb8379d..356a284e0 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -868,10 +868,10 @@ public:
static bool ReportErrors(lua_State * a_LuaState, int status);
/** Logs all items in the current stack trace to the server console */
- void LogStackTrace(void);
+ void LogStackTrace(int a_StartingDepth = 0);
/** Logs all items in the current stack trace to the server console */
- static void LogStackTrace(lua_State * a_LuaState);
+ static void LogStackTrace(lua_State * a_LuaState, int a_StartingDepth = 0);
/** Returns the type of the item on the specified position in the stack */
AString GetTypeText(int a_StackPos);