Fixed squid health attribute errors

This commit is contained in:
Dylan K. Taylor
2017-04-21 14:42:19 +01:00
parent a356e36340
commit e7406ba096
3 changed files with 3 additions and 4 deletions

View File

@ -68,7 +68,7 @@ abstract class Living extends Entity implements Damageable{
public function setHealth($amount){
$wasAlive = $this->isAlive();
parent::setHealth($amount);
$this->attributeMap->getAttribute(Attribute::HEALTH)->setValue($this->getHealth());
$this->attributeMap->getAttribute(Attribute::HEALTH)->setValue($this->getHealth(), true);
if($this->isAlive() and !$wasAlive){
$pk = new EntityEventPacket();
$pk->eid = $this->getId();