Skip to content

Commit

Permalink
Readded old DistributeStackToAreas() comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Howaner committed Jan 24, 2015
1 parent 1eedccc commit 1f94c31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/UI/Window.cpp
Expand Up @@ -393,11 +393,14 @@ bool cWindow::ForEachClient(cItemCallback<cClientHandle> & a_Callback)

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++)
/* Ask each slot area to take as much of the stack as it can.
First ask only slots that already have the same kind of item
Then ask any remaining slots */
for (size_t Pass = 0; Pass < 2; Pass++)
{
for (auto SlotArea : a_AreasInOrder)
{
SlotArea->DistributeStack(a_ItemStack, a_Player, a_ShouldApply, (i == 0), a_BackFill);
SlotArea->DistributeStack(a_ItemStack, a_Player, a_ShouldApply, (Pass == 0), a_BackFill);
if (a_ItemStack.IsEmpty())
{
// Distributed it all
Expand Down

0 comments on commit 1f94c31

Please sign in to comment.