BaseInventory: fixed internalAddItem() doing useless canStackWith() checks on null items

if the item is null, it's never going to stack with anything given to this function, because addItem() already discards null items.
This commit is contained in:
Dylan K. Taylor 2023-04-27 14:53:54 +01:00
parent 2910ffebf4
commit 023460db2c
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -219,6 +219,7 @@ abstract class BaseInventory implements Inventory{
$item = $this->getItem($i);
if($item->isNull()){
$emptySlots[] = $i;
continue;
}
if($slot->canStackWith($item) && $item->getCount() < $item->getMaxStackSize()){