diff options
author | madmaxoft <github@xoft.cz> | 2014-01-29 22:56:23 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-01-29 22:56:38 +0100 |
commit | b61a74d6a20f063e776bb02e471a213da32c1000 (patch) | |
tree | a420de33ab04d5e467ce68f08e04847c1573bc42 | |
parent | Merge pull request #599 from tonibm19/master (diff) | |
download | cuberite-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 |
-rw-r--r-- | src/Bindings/LuaState.cpp | 6 |
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; |