Fix players regenerating health from food while dead, fixes issue 2 in #23

This commit is contained in:
Dylan K. Taylor 2017-01-09 14:10:05 +00:00
parent 67940ad6ab
commit 441961b199

View File

@ -347,6 +347,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
public function entityBaseTick($tickDiff = 1){
$hasUpdate = parent::entityBaseTick($tickDiff);
if($this->isAlive()){
$food = $this->getFood();
$health = $this->getHealth();
if($food >= 18){
@ -379,6 +380,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
$this->setSprinting(false);
}
}
}
return $hasUpdate;
}