diff options
author | Mattes D <github@xoft.cz> | 2016-08-16 13:02:08 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-08-22 20:09:56 +0200 |
commit | 9493488e48c49a54e9b1ec892107735de6736c13 (patch) | |
tree | e8f2756003714cf54ebda9168016130b5c0a1432 /src/Bindings/LuaState.cpp | |
parent | cLuaState: Added support for optional params and AStringMap values. (diff) | |
download | cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.gz cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.bz2 cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.lz cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.xz cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.zst cuberite-9493488e48c49a54e9b1ec892107735de6736c13.zip |
Diffstat (limited to 'src/Bindings/LuaState.cpp')
-rw-r--r-- | src/Bindings/LuaState.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index b5832802d..2e1415519 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -42,6 +42,7 @@ extern "C" const cLuaState::cRet cLuaState::Return = {}; +const cLuaState::cNil cLuaState::Nil = {}; /** Each Lua state stores a pointer to its creating cLuaState in Lua globals, under this name. This way any cLuaState can reference the main cLuaState's TrackedCallbacks, mutex etc. */ @@ -751,18 +752,6 @@ bool cLuaState::PushFunction(const cRef & a_TableRef, const char * a_FnName) -void cLuaState::PushNil(void) -{ - ASSERT(IsValid()); - - lua_pushnil(m_LuaState); - m_NumCurrentFunctionArgs += 1; -} - - - - - void cLuaState::Push(const AString & a_String) { ASSERT(IsValid()); @@ -860,6 +849,18 @@ void cLuaState::Push(const cItems & a_Items) +void cLuaState::Push(const cNil & a_Nil) +{ + ASSERT(IsValid()); + + lua_pushnil(m_LuaState); + m_NumCurrentFunctionArgs += 1; +} + + + + + void cLuaState::Push(const cPlayer * a_Player) { ASSERT(IsValid()); |