summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-16 14:05:03 +0200
committerMattes D <github@xoft.cz>2016-08-22 20:10:48 +0200
commit11682d1386299d78bab39f77884797981950edee (patch)
tree370699cd4ec1ff5905d970005162c8be3aa275dd /src/Bindings/LuaState.h
parentcLuaState: Added direct support for pushing a nil constant. (diff)
downloadcuberite-11682d1386299d78bab39f77884797981950edee.tar
cuberite-11682d1386299d78bab39f77884797981950edee.tar.gz
cuberite-11682d1386299d78bab39f77884797981950edee.tar.bz2
cuberite-11682d1386299d78bab39f77884797981950edee.tar.lz
cuberite-11682d1386299d78bab39f77884797981950edee.tar.xz
cuberite-11682d1386299d78bab39f77884797981950edee.tar.zst
cuberite-11682d1386299d78bab39f77884797981950edee.zip
Diffstat (limited to 'src/Bindings/LuaState.h')
-rw-r--r--src/Bindings/LuaState.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index 3c07ac5d2..cb68b9a98 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -634,6 +634,7 @@ public:
template <typename FnT, typename... Args>
bool Call(const FnT & a_Function, Args &&... args)
{
+ m_NumCurrentFunctionArgs = -1;
if (!PushFunction(std::forward<const FnT &>(a_Function)))
{
// Pushing the function failed
@@ -795,6 +796,7 @@ protected:
inline bool PushCallPop(T && a_Param, Args &&... args)
{
Push(std::forward<T>(a_Param));
+ m_NumCurrentFunctionArgs += 1;
return PushCallPop(std::forward<Args>(args)...);
}