From 98e9b5594c87e101333fe576f931549a7c29285c Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 22 May 2014 20:32:56 +0200 Subject: [PATCH] Fixed slots overfilling (like on Armor slots) --- src/pocketmine/inventory/BaseInventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/inventory/BaseInventory.php b/src/pocketmine/inventory/BaseInventory.php index 4fda1504d..84a62b08a 100644 --- a/src/pocketmine/inventory/BaseInventory.php +++ b/src/pocketmine/inventory/BaseInventory.php @@ -205,7 +205,7 @@ abstract class BaseInventory implements Inventory{ foreach($slots as $index => $slot){ if($slot->equals($item, $slot->getDamage() === null ? false : true)){ if($item->getCount() < $item->getMaxStackSize()){ - $amount = min($item->getMaxStackSize() - $item->getCount(), $slot->getCount()); + $amount = min($item->getMaxStackSize() - $item->getCount(), $slot->getCount(), $this->getMaxStackSize()); $slot->setCount($slot->getCount() - $amount); $old = clone $item; $item->setCount($item->getCount() + $amount);