mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-19 04:05:31 +00:00
Fixed possible armor crash
This commit is contained in:
parent
ea17ff9d9b
commit
6c941977f3
@ -1438,6 +1438,7 @@ class Player{
|
|||||||
if($slot->getID() !== AIR and $s->getID() === AIR){
|
if($slot->getID() !== AIR and $s->getID() === AIR){
|
||||||
$this->addItem($slot->getID(), $slot->getMetadata(), 1, false);
|
$this->addItem($slot->getID(), $slot->getMetadata(), 1, false);
|
||||||
$this->armor[$i] = BlockAPI::getItem(AIR, 0, 0);
|
$this->armor[$i] = BlockAPI::getItem(AIR, 0, 0);
|
||||||
|
$data["slot$i"] = 255;
|
||||||
}elseif($s->getID() !== AIR and $slot->getID() === AIR and ($sl = $this->hasItem($s->getID())) !== false){
|
}elseif($s->getID() !== AIR and $slot->getID() === AIR and ($sl = $this->hasItem($s->getID())) !== false){
|
||||||
$this->armor[$i] = $this->getSlot($sl);
|
$this->armor[$i] = $this->getSlot($sl);
|
||||||
$this->setSlot($sl, BlockAPI::getItem(AIR, 0, 0), false);
|
$this->setSlot($sl, BlockAPI::getItem(AIR, 0, 0), false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user