Proper same armor check

This commit is contained in:
Shoghi Cervantes 2013-08-20 12:52:06 +02:00
parent 6c941977f3
commit 3ba213f2f0

View File

@ -1442,7 +1442,7 @@ class Player{
}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);
}elseif($s->getID() !== AIR and $slot->getID() !== AIR and ($sl = $this->hasItem($s->getID())) !== false){ }elseif($s->getID() !== AIR and $slot->getID() !== AIR and ($slot->getID() !== $s->getID() or $slot->getMetadata() !== $s->getMetadata()) and ($sl = $this->hasItem($s->getID())) !== false){
$item = $this->armor[$i]; $item = $this->armor[$i];
$this->armor[$i] = $this->getSlot($sl); $this->armor[$i] = $this->getSlot($sl);
$this->setSlot($sl, $item, false); $this->setSlot($sl, $item, false);