mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Heap of bugfixes, cleanup and PHP 7 upgrades
This commit is contained in:
@ -141,13 +141,16 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$attr = $this->attributeMap->getAttribute(Attribute::HUNGER);
|
||||
$old = $attr->getValue();
|
||||
$attr->setValue($new);
|
||||
|
||||
$reset = false;
|
||||
// ranges: 18-20 (regen), 7-17 (none), 1-6 (no sprint), 0 (health depletion)
|
||||
foreach([17, 6, 0] as $bound){
|
||||
if(($old > $bound) !== ($new > $bound)){
|
||||
$reset = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(isset($reset)){
|
||||
if($reset){
|
||||
$this->foodTickTimer = 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user