1
0

cWindow: Fixed item dupe glitch with painting (#278)

This commit is contained in:
madmaxoft 2013-11-12 13:15:09 +01:00
parent 8fa8107e45
commit 11c5ad1170

View File

@ -628,7 +628,7 @@ int cWindow::DistributeItemToSlots(cPlayer & a_Player, const cItem & a_Item, int
// Modify the item at the slot
cItem AtSlot(*Area->GetSlot(LocalSlotNum, a_Player));
int MaxStack = ItemHandler(AtSlot.m_ItemType)->GetMaxStackSize();
int MaxStack = AtSlot.GetMaxStackSize();
if (AtSlot.IsEmpty())
{
// Empty, just move all of it there:
@ -637,7 +637,7 @@ int cWindow::DistributeItemToSlots(cPlayer & a_Player, const cItem & a_Item, int
Area->SetSlot(LocalSlotNum, a_Player, ToStore);
NumDistributed += ToStore.m_ItemCount;
}
else
else if (AtSlot.IsStackableWith(a_Item))
{
// Occupied, add and cap at MaxStack:
int CanStore = std::min(a_NumToEachSlot, (int)MaxStack - AtSlot.m_ItemCount);