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/UI/Window.cpp | |
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 '')
-rw-r--r-- | src/UI/Window.cpp | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp index 0cb501a65..8bb7607ff 100644 --- a/src/UI/Window.cpp +++ b/src/UI/Window.cpp @@ -391,31 +391,13 @@ bool cWindow::ForEachClient(cItemCallback<cClientHandle> & a_Callback) -void cWindow::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); - } - } - - DistributeStack(a_ItemStack, a_Player, Areas, a_ShouldApply, false); -} - - - - - -void cWindow::DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, cSlotAreas & a_AreasInOrder, bool a_ShouldApply, bool a_BackFill) +void cWindow::DistributeStackToAreas(cItem & a_ItemStack, cPlayer & a_Player, cSlotAreas & a_AreasInOrder, bool a_ShouldApply, bool a_BackFill) { for (size_t i = 0; i < 2; i++) { - for (cSlotAreas::iterator itr = a_AreasInOrder.begin(); itr != a_AreasInOrder.end(); ++itr) + for (auto SlotArea : a_AreasInOrder) { - (*itr)->DistributeStack(a_ItemStack, a_Player, a_ShouldApply, (i == 0), a_BackFill); + SlotArea->DistributeStack(a_ItemStack, a_Player, a_ShouldApply, (i == 0), a_BackFill); if (a_ItemStack.IsEmpty()) { // Distributed it all |