mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Fixed PlayerInventory->setItem() with null items
This commit is contained in:
parent
d63a82de0a
commit
fd954ce708
@ -202,8 +202,8 @@ class PlayerInventory extends BaseInventory{
|
|||||||
public function setItem($index, Item $item, $source = null){
|
public function setItem($index, Item $item, $source = null){
|
||||||
if($index < 0 or $index >= $this->size){
|
if($index < 0 or $index >= $this->size){
|
||||||
return false;
|
return false;
|
||||||
}elseif($item->getID() === 0){
|
}elseif($item->getID() === 0 or $item->getCount() <= 0){
|
||||||
$this->clear($index, $source);
|
return $this->clear($index, $source);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($index >= $this->getSize()){ //Armor change
|
if($index >= $this->getSize()){ //Armor change
|
||||||
|
Loading…
x
Reference in New Issue
Block a user