mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 03:47:16 +00:00
Check inventory slot is in range in SlotChangeAction
This commit is contained in:
parent
88318d740a
commit
98ac6fc7be
@ -75,8 +75,11 @@ class SlotChangeAction extends InventoryAction{
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid(Player $source) : bool{
|
||||
$check = $this->inventory->getItem($this->inventorySlot);
|
||||
return $check->equalsExact($this->sourceItem);
|
||||
return (
|
||||
$this->inventorySlot >= 0 and
|
||||
$this->inventorySlot < $this->inventory->getSize() and
|
||||
$this->inventory->getItem($this->inventorySlot)->equalsExact($this->sourceItem)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user