diff options
author | Mattes D <github@xoft.cz> | 2016-03-02 10:12:43 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-06-27 20:51:49 +0200 |
commit | 4489a89fdec9f4a507400150af34623899b64f46 (patch) | |
tree | 442c2c06ec3c06598d86e28c0745ecbbc5dc2feb /src/Bindings/LuaState.cpp | |
parent | Removed cWebPlugin, WebAdmin uses cLuaState::cCallback. (diff) | |
download | cuberite-4489a89fdec9f4a507400150af34623899b64f46.tar cuberite-4489a89fdec9f4a507400150af34623899b64f46.tar.gz cuberite-4489a89fdec9f4a507400150af34623899b64f46.tar.bz2 cuberite-4489a89fdec9f4a507400150af34623899b64f46.tar.lz cuberite-4489a89fdec9f4a507400150af34623899b64f46.tar.xz cuberite-4489a89fdec9f4a507400150af34623899b64f46.tar.zst cuberite-4489a89fdec9f4a507400150af34623899b64f46.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/LuaState.cpp | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index ffe1fe4ac..28274d681 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -170,6 +170,16 @@ void cLuaState::cCallback::Clear(void) +bool cLuaState::cCallback::IsValid(void) +{ + cCSLock lock(m_CS); + return m_Ref.IsValid(); +} + + + + + void cLuaState::cCallback::Invalidate(void) { cCSLock Lock(m_CS); @@ -935,6 +945,24 @@ bool cLuaState::GetStackValue(int a_StackPos, bool & a_ReturnedVal) +bool cLuaState::GetStackValue(int a_StackPos, cCallback & a_Callback) +{ + return a_Callback.RefStack(*this, a_StackPos); +} + + + + + +bool cLuaState::GetStackValue(int a_StackPos, cCallbackPtr & a_Callback) +{ + return a_Callback->RefStack(*this, a_StackPos); +} + + + + + bool cLuaState::GetStackValue(int a_StackPos, cPluginManager::CommandResult & a_Result) { if (lua_isnumber(m_LuaState, a_StackPos)) @@ -959,15 +987,6 @@ bool cLuaState::GetStackValue(int a_StackPos, cRef & a_Ref) -bool cLuaState::GetStackValue(int a_StackPos, cCallback & a_Callback) -{ - return a_Callback.RefStack(*this, a_StackPos); -} - - - - - bool cLuaState::GetStackValue(int a_StackPos, double & a_ReturnedVal) { if (lua_isnumber(m_LuaState, a_StackPos)) |