diff options
author | madmaxoft <github@xoft.cz> | 2013-08-11 14:57:07 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-08-11 14:57:07 +0200 |
commit | dd60f55bccd603650906d5025f689a82d00b3718 (patch) | |
tree | 773db077844972b21488c448f88572ca691baa51 /source/LuaState.cpp | |
parent | Added an AllowEmptyStacks param to cItemGrid::HowManyCanFit(). (diff) | |
download | cuberite-dd60f55bccd603650906d5025f689a82d00b3718.tar cuberite-dd60f55bccd603650906d5025f689a82d00b3718.tar.gz cuberite-dd60f55bccd603650906d5025f689a82d00b3718.tar.bz2 cuberite-dd60f55bccd603650906d5025f689a82d00b3718.tar.lz cuberite-dd60f55bccd603650906d5025f689a82d00b3718.tar.xz cuberite-dd60f55bccd603650906d5025f689a82d00b3718.tar.zst cuberite-dd60f55bccd603650906d5025f689a82d00b3718.zip |
Diffstat (limited to '')
-rw-r--r-- | source/LuaState.cpp | 26 |
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); |