summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-29 22:56:23 +0100
committermadmaxoft <github@xoft.cz>2014-01-29 22:56:38 +0100
commitb61a74d6a20f063e776bb02e471a213da32c1000 (patch)
treea420de33ab04d5e467ce68f08e04847c1573bc42 /src
parentMerge pull request #599 from tonibm19/master (diff)
downloadcuberite-b61a74d6a20f063e776bb02e471a213da32c1000.tar
cuberite-b61a74d6a20f063e776bb02e471a213da32c1000.tar.gz
cuberite-b61a74d6a20f063e776bb02e471a213da32c1000.tar.bz2
cuberite-b61a74d6a20f063e776bb02e471a213da32c1000.tar.lz
cuberite-b61a74d6a20f063e776bb02e471a213da32c1000.tar.xz
cuberite-b61a74d6a20f063e776bb02e471a213da32c1000.tar.zst
cuberite-b61a74d6a20f063e776bb02e471a213da32c1000.zip
Diffstat (limited to 'src')
-rw-r--r--src/Bindings/LuaState.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 2fca7142c..d49cd8ef3 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -289,9 +289,13 @@ bool cLuaState::PushFunction(const cTableRef & a_TableRef)
if (lua_isnil(m_LuaState, -1) || !lua_isfunction(m_LuaState, -1))
{
// Not a valid function, bail out
- lua_pop(m_LuaState, 2);
+ lua_pop(m_LuaState, 3);
return false;
}
+
+ // Pop the table off the stack:
+ lua_remove(m_LuaState, -2);
+
Printf(m_CurrentFunctionName, "<table-callback %s>", a_TableRef.GetFnName());
m_NumCurrentFunctionArgs = 0;
return true;