summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-04-23 22:52:34 +0200
committerMattes D <github@xoft.cz>2015-04-23 22:52:34 +0200
commit0bfcd625566f965d993eb8e58be6c73c3714bb08 (patch)
tree79efad21cec681afa82487a7a8a8fe39320ebbf0 /src/Bindings/LuaState.cpp
parentDigging up a clay block spawns 4 clay items. (diff)
parentRefactored ManualBindings' callbacks using templates. (diff)
downloadcuberite-0bfcd625566f965d993eb8e58be6c73c3714bb08.tar
cuberite-0bfcd625566f965d993eb8e58be6c73c3714bb08.tar.gz
cuberite-0bfcd625566f965d993eb8e58be6c73c3714bb08.tar.bz2
cuberite-0bfcd625566f965d993eb8e58be6c73c3714bb08.tar.lz
cuberite-0bfcd625566f965d993eb8e58be6c73c3714bb08.tar.xz
cuberite-0bfcd625566f965d993eb8e58be6c73c3714bb08.tar.zst
cuberite-0bfcd625566f965d993eb8e58be6c73c3714bb08.zip
Diffstat (limited to 'src/Bindings/LuaState.cpp')
-rw-r--r--src/Bindings/LuaState.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 468e54f32..38e008b2a 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -1013,6 +1013,24 @@ void cLuaState::GetStackValue(int a_StackPos, pBoundingBox & a_ReturnedVal)
+void cLuaState::GetStackValue(int a_StackPos, pMapManager & a_ReturnedVal)
+{
+ if (lua_isnil(m_LuaState, a_StackPos))
+ {
+ a_ReturnedVal = nullptr;
+ return;
+ }
+ tolua_Error err;
+ if (tolua_isusertype(m_LuaState, a_StackPos, "cMapManager", false, &err))
+ {
+ a_ReturnedVal = *(reinterpret_cast<cMapManager **>(lua_touserdata(m_LuaState, a_StackPos)));
+ }
+}
+
+
+
+
+
void cLuaState::GetStackValue(int a_StackPos, pPluginManager & a_ReturnedVal)
{
if (lua_isnil(m_LuaState, a_StackPos))