summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-02-04 09:18:32 +0100
committermadmaxoft <github@xoft.cz>2014-02-04 09:18:32 +0100
commitaa19f4fd042c7085d1b7f6d692ffee7bf5a7ff80 (patch)
tree8b4e92d548fae4096211da47f2e93e8efab47cdb
parentInfoDump: Fixed export for undeclared command param combinations. (diff)
downloadcuberite-aa19f4fd042c7085d1b7f6d692ffee7bf5a7ff80.tar
cuberite-aa19f4fd042c7085d1b7f6d692ffee7bf5a7ff80.tar.gz
cuberite-aa19f4fd042c7085d1b7f6d692ffee7bf5a7ff80.tar.bz2
cuberite-aa19f4fd042c7085d1b7f6d692ffee7bf5a7ff80.tar.lz
cuberite-aa19f4fd042c7085d1b7f6d692ffee7bf5a7ff80.tar.xz
cuberite-aa19f4fd042c7085d1b7f6d692ffee7bf5a7ff80.tar.zst
cuberite-aa19f4fd042c7085d1b7f6d692ffee7bf5a7ff80.zip
-rw-r--r--src/Bindings/LuaState.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index d49cd8ef3..6a02197e8 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -1066,6 +1066,8 @@ int cLuaState::CallFunctionWithForeignParams(
{
// Something went wrong, fix the stack and exit
lua_pop(m_LuaState, 2);
+ m_NumCurrentFunctionArgs = -1;
+ m_CurrentFunctionName.clear();
return -1;
}
@@ -1081,11 +1083,17 @@ int cLuaState::CallFunctionWithForeignParams(
{
lua_pop(m_LuaState, CurTop - OldTop);
}
+
+ // Reset the internal checking mechanisms:
+ m_NumCurrentFunctionArgs = -1;
+ m_CurrentFunctionName.clear();
+
return -1;
}
// Reset the internal checking mechanisms:
m_NumCurrentFunctionArgs = -1;
+ m_CurrentFunctionName.clear();
// Remove the error handler from the stack:
lua_remove(m_LuaState, OldTop + 1);