mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 21:35:21 +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){
|
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