summaryrefslogtreecommitdiffstats
path: root/src/LuaState.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-30 14:22:26 +0100
committermadmaxoft <github@xoft.cz>2013-11-30 14:22:26 +0100
commit2383016b1d673fcf0ad69a08bba62d7ce36cdd76 (patch)
tree97bc44cd3d747b3cbe5a2794419c17eb7c177ba0 /src/LuaState.h
parentGrass doesn't spread to podzol or grassless dirt blocks. (diff)
downloadcuberite-2383016b1d673fcf0ad69a08bba62d7ce36cdd76.tar
cuberite-2383016b1d673fcf0ad69a08bba62d7ce36cdd76.tar.gz
cuberite-2383016b1d673fcf0ad69a08bba62d7ce36cdd76.tar.bz2
cuberite-2383016b1d673fcf0ad69a08bba62d7ce36cdd76.tar.lz
cuberite-2383016b1d673fcf0ad69a08bba62d7ce36cdd76.tar.xz
cuberite-2383016b1d673fcf0ad69a08bba62d7ce36cdd76.tar.zst
cuberite-2383016b1d673fcf0ad69a08bba62d7ce36cdd76.zip
Diffstat (limited to '')
-rw-r--r--src/LuaState.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/LuaState.h b/src/LuaState.h
index 5e7f3d180..15b0cdeff 100644
--- a/src/LuaState.h
+++ b/src/LuaState.h
@@ -224,6 +224,22 @@ public:
return CallFunction(0);
}
+ /// Call any 3-param 0-return Lua function in a single line:
+ template<
+ typename FnT, typename ArgT1, typename ArgT2, typename ArgT3
+ >
+ bool Call(FnT a_FnName, ArgT1 a_Arg1, ArgT2 a_Arg2, ArgT3 a_Arg3)
+ {
+ if (!PushFunction(a_FnName))
+ {
+ return false;
+ }
+ Push(a_Arg1);
+ Push(a_Arg2);
+ Push(a_Arg3);
+ return CallFunction(0);
+ }
+
/// Call any 1-param 1-return Lua function in a single line:
template<
typename FnT, typename ArgT1, typename RetT1