mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
BaseInventory: fixed internalAddItem() setting air slots to air
this bug was introduced in #4237, but it was unnoticed due to having no adverse effects other than noisy debugs and network traffic.
This commit is contained in:
parent
0910a219d4
commit
b4b6bbe29f
@ -256,7 +256,7 @@ abstract class BaseInventory implements Inventory, SlotValidatedInventory{
|
|||||||
$slotItem->setCount($slotItem->getCount() + $amount);
|
$slotItem->setCount($slotItem->getCount() + $amount);
|
||||||
$this->setItem($i, $slotItem);
|
$this->setItem($i, $slotItem);
|
||||||
if($newItem->getCount() <= 0){
|
if($newItem->getCount() <= 0){
|
||||||
break;
|
return $newItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,7 +270,7 @@ abstract class BaseInventory implements Inventory, SlotValidatedInventory{
|
|||||||
$slotItem->setCount($amount);
|
$slotItem->setCount($amount);
|
||||||
$this->setItem($slotIndex, $slotItem);
|
$this->setItem($slotIndex, $slotItem);
|
||||||
if($newItem->getCount() <= 0){
|
if($newItem->getCount() <= 0){
|
||||||
break;
|
return $newItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user