diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:45:45 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:50:18 +0100 |
commit | ca6ef58b1ee8521e4b940ee4883dee714960e413 (patch) | |
tree | 8532add455224b07c07a759e3d906f50c0695888 /src/Bindings/LuaWindow.cpp | |
parent | Merge pull request #2972 from marvinkopf/PlayerAutoComplete (diff) | |
download | cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2 cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/LuaWindow.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Bindings/LuaWindow.cpp b/src/Bindings/LuaWindow.cpp index 5f7832ef5..706397a27 100644 --- a/src/Bindings/LuaWindow.cpp +++ b/src/Bindings/LuaWindow.cpp @@ -25,7 +25,7 @@ cLuaWindow::cLuaWindow(cWindow::WindowType a_WindowType, int a_SlotsX, int a_Slo { m_Contents.AddListener(*this); m_SlotAreas.push_back(new cSlotAreaItemGrid(m_Contents, *this)); - + // If appropriate, add an Armor slot area: switch (a_WindowType) { @@ -93,13 +93,13 @@ void cLuaWindow::SetOnClosing(cPluginLua * a_Plugin, int a_FnRef) { // Either m_Plugin is not set or equal to the passed plugin; only one plugin can use one cLuaWindow object ASSERT((m_Plugin == nullptr) || (m_Plugin == a_Plugin)); - + // If there already was a function, unreference it first if (m_OnClosingFnRef != LUA_REFNIL) { m_Plugin->Unreference(m_OnClosingFnRef); } - + // Store the new reference m_Plugin = a_Plugin; m_OnClosingFnRef = a_FnRef; @@ -113,13 +113,13 @@ void cLuaWindow::SetOnSlotChanged(cPluginLua * a_Plugin, int a_FnRef) { // Either m_Plugin is not set or equal to the passed plugin; only one plugin can use one cLuaWindow object ASSERT((m_Plugin == nullptr) || (m_Plugin == a_Plugin)); - + // If there already was a function, unreference it first if (m_OnSlotChangedFnRef != LUA_REFNIL) { m_Plugin->Unreference(m_OnSlotChangedFnRef); } - + // Store the new reference m_Plugin = a_Plugin; m_OnSlotChangedFnRef = a_FnRef; @@ -141,7 +141,7 @@ bool cLuaWindow::ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse) return false; } } - + return super::ClosedByPlayer(a_Player, a_CanRefuse); } @@ -152,13 +152,13 @@ bool cLuaWindow::ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse) void cLuaWindow::Destroy(void) { super::Destroy(); - + if ((m_LuaRef != LUA_REFNIL) && (m_Plugin != nullptr)) { // The object is referenced by Lua, un-reference it m_Plugin->Unreference(m_LuaRef); } - + // Lua will take care of this object, it will garbage-collect it, so we must not delete it! m_IsDestroyed = false; } @@ -192,7 +192,7 @@ void cLuaWindow::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) ASSERT(!"Invalid ItemGrid in callback"); return; } - + // If an OnSlotChanged callback has been registered, call it: if (m_OnSlotChangedFnRef != LUA_REFNIL) { |