mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 23:15:29 +00:00
Fix players regenerating health from food while dead, fixes issue 2 in #23
This commit is contained in:
parent
67940ad6ab
commit
441961b199
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user