mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 05:15:13 +00:00
Fix players regenerating health from food while dead, fixes issue 2 in #23
This commit is contained in:
parent
6fbb9b6083
commit
92b85e0f15
@ -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