diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-12-17 19:14:01 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-12-17 19:14:01 +0100 |
commit | 8277e1ec4e3e761527bc850ac371f3b899d023bf (patch) | |
tree | 5a5cb6bb1609e24bdd32ddbfb9354e158b51f161 /src/Bindings | |
parent | Merge branch 'master' into Inventory (diff) | |
download | cuberite-8277e1ec4e3e761527bc850ac371f3b899d023bf.tar cuberite-8277e1ec4e3e761527bc850ac371f3b899d023bf.tar.gz cuberite-8277e1ec4e3e761527bc850ac371f3b899d023bf.tar.bz2 cuberite-8277e1ec4e3e761527bc850ac371f3b899d023bf.tar.lz cuberite-8277e1ec4e3e761527bc850ac371f3b899d023bf.tar.xz cuberite-8277e1ec4e3e761527bc850ac371f3b899d023bf.tar.zst cuberite-8277e1ec4e3e761527bc850ac371f3b899d023bf.zip |
Diffstat (limited to 'src/Bindings')
-rw-r--r-- | src/Bindings/LuaWindow.cpp | 18 | ||||
-rw-r--r-- | src/Bindings/LuaWindow.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/Bindings/LuaWindow.cpp b/src/Bindings/LuaWindow.cpp index 35730878d..d4014059b 100644 --- a/src/Bindings/LuaWindow.cpp +++ b/src/Bindings/LuaWindow.cpp @@ -167,6 +167,24 @@ void cLuaWindow::Destroy(void) +void cLuaWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer& a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) +{ + cSlotAreas Areas; + for (auto Area : m_SlotAreas) + { + if (Area != a_ClickedArea) + { + Areas.push_back(Area); + } + } + + super::DistributeStackToAreas(a_ItemStack, a_Player, Areas, a_ShouldApply, false); +} + + + + + void cLuaWindow::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) { if (a_ItemGrid != &m_Contents) diff --git a/src/Bindings/LuaWindow.h b/src/Bindings/LuaWindow.h index dab99a2e2..76530d99d 100644 --- a/src/Bindings/LuaWindow.h +++ b/src/Bindings/LuaWindow.h @@ -84,6 +84,7 @@ protected: // cWindow overrides: virtual bool ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse) override; virtual void Destroy(void) override; + virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override; // cItemGrid::cListener overrides: virtual void OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) override; |