summaryrefslogtreecommitdiffstats
path: root/source/LuaState.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-13 16:44:29 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-13 16:44:29 +0200
commit0ac24a98e4055f791f7dccee89997a7852c865b7 (patch)
treef1c361afa8142dcc1a169404b4f8deccb7dcf6b9 /source/LuaState.cpp
parentRemoved comments (diff)
parentMerge pull request #84 from tonibm19/patch-2 (diff)
downloadcuberite-0ac24a98e4055f791f7dccee89997a7852c865b7.tar
cuberite-0ac24a98e4055f791f7dccee89997a7852c865b7.tar.gz
cuberite-0ac24a98e4055f791f7dccee89997a7852c865b7.tar.bz2
cuberite-0ac24a98e4055f791f7dccee89997a7852c865b7.tar.lz
cuberite-0ac24a98e4055f791f7dccee89997a7852c865b7.tar.xz
cuberite-0ac24a98e4055f791f7dccee89997a7852c865b7.tar.zst
cuberite-0ac24a98e4055f791f7dccee89997a7852c865b7.zip
Diffstat (limited to 'source/LuaState.cpp')
-rw-r--r--source/LuaState.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/LuaState.cpp b/source/LuaState.cpp
index 7462181ad..6de8f3dc1 100644
--- a/source/LuaState.cpp
+++ b/source/LuaState.cpp
@@ -677,6 +677,32 @@ void cLuaState::Push(void * a_Ptr)
+void cLuaState::Push(cHopperEntity * a_Hopper)
+{
+ ASSERT(IsValid());
+ ASSERT(m_NumCurrentFunctionArgs >= 0); // A function must be pushed to stack first
+
+ tolua_pushusertype(m_LuaState, a_Hopper, "cHopperEntity");
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
+void cLuaState::Push(cBlockEntity * a_BlockEntity)
+{
+ ASSERT(IsValid());
+ ASSERT(m_NumCurrentFunctionArgs >= 0); // A function must be pushed to stack first
+
+ tolua_pushusertype(m_LuaState, a_BlockEntity, "cBlockEntity");
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
void cLuaState::GetReturn(int a_StackPos, bool & a_ReturnedVal)
{
a_ReturnedVal = (tolua_toboolean(m_LuaState, a_StackPos, a_ReturnedVal ? 1 : 0) > 0);