diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-02-01 00:31:05 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-02-01 00:31:05 +0100 |
commit | fec17409d2f566af18bad269fe2c5c372a474ecb (patch) | |
tree | 93baa2311e38fddb86a68e550955c261ac96cf3b /src/Bindings/LuaState.cpp | |
parent | Changed signitures of Several BLockHandler Methods (diff) | |
parent | Contributors now match real life, and are alpha-sorted. (diff) | |
download | cuberite-fec17409d2f566af18bad269fe2c5c372a474ecb.tar cuberite-fec17409d2f566af18bad269fe2c5c372a474ecb.tar.gz cuberite-fec17409d2f566af18bad269fe2c5c372a474ecb.tar.bz2 cuberite-fec17409d2f566af18bad269fe2c5c372a474ecb.tar.lz cuberite-fec17409d2f566af18bad269fe2c5c372a474ecb.tar.xz cuberite-fec17409d2f566af18bad269fe2c5c372a474ecb.tar.zst cuberite-fec17409d2f566af18bad269fe2c5c372a474ecb.zip |
Diffstat (limited to 'src/Bindings/LuaState.cpp')
-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; |