diff options
author | Mattes D <github@xoft.cz> | 2015-04-23 22:52:34 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-04-23 22:52:34 +0200 |
commit | 0bfcd625566f965d993eb8e58be6c73c3714bb08 (patch) | |
tree | 79efad21cec681afa82487a7a8a8fe39320ebbf0 /src/Bindings/LuaState.cpp | |
parent | Digging up a clay block spawns 4 clay items. (diff) | |
parent | Refactored ManualBindings' callbacks using templates. (diff) | |
download | cuberite-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.cpp | 18 |
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)) |