mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-14 15:35:31 +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){
|
public function entityBaseTick($tickDiff = 1){
|
||||||
$hasUpdate = parent::entityBaseTick($tickDiff);
|
$hasUpdate = parent::entityBaseTick($tickDiff);
|
||||||
|
|
||||||
|
if($this->isAlive()){
|
||||||
$food = $this->getFood();
|
$food = $this->getFood();
|
||||||
$health = $this->getHealth();
|
$health = $this->getHealth();
|
||||||
if($food >= 18){
|
if($food >= 18){
|
||||||
@ -379,6 +380,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
$this->setSprinting(false);
|
$this->setSprinting(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $hasUpdate;
|
return $hasUpdate;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user