From 11682d1386299d78bab39f77884797981950edee Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 16 Aug 2016 14:05:03 +0200 Subject: cLuaState: Moved function param counting to PushCallPop() template. The Push() functions can be used not only for function params, but also returns or temporaries, so it doesn't make sense to count the params there. --- src/Bindings/LuaState.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Bindings/LuaState.h') 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 bool Call(const FnT & a_Function, Args &&... args) { + m_NumCurrentFunctionArgs = -1; if (!PushFunction(std::forward(a_Function))) { // Pushing the function failed @@ -795,6 +796,7 @@ protected: inline bool PushCallPop(T && a_Param, Args &&... args) { Push(std::forward(a_Param)); + m_NumCurrentFunctionArgs += 1; return PushCallPop(std::forward(args)...); } -- cgit v1.2.3