From 3498c876df5b697599fa67560703457c41b7a215 Mon Sep 17 00:00:00 2001 From: Michael Yoo Date: Sat, 9 Nov 2013 20:43:06 +1030 Subject: [PATCH] Reset player's armors after death --- src/world/Entity.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/world/Entity.php b/src/world/Entity.php index 51bbe3c60..25840944a 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -167,6 +167,15 @@ class Entity extends Position{ $inv[] = array($slot->getID(), $slot->getMetadata(), $slot->count); } } + for($re = 0; $re < 3; $re++) + { + //TODO: Test this. + $slot = $this->player->getArmor($re); + $this->player->setArmor($re, BlockAPI::getItem(AIR, 0, 0)); + if($slot->getID() !== AIR and $slot->count > 0){ + $inv[] = array($slot->getID(), $slot->getMetadata(), $slot->count); + } + } return $inv; }elseif($this->class === ENTITY_OBJECT){ switch($this->type){