mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 16:05:28 +00:00
Human: fixed hunger underflow when value is a fraction, closes #2761
This commit is contained in:
parent
44697e784a
commit
e1bacb5c6d
@ -301,7 +301,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
$food = $this->getFood();
|
$food = $this->getFood();
|
||||||
if($food > 0){
|
if($food > 0){
|
||||||
$food--;
|
$food--;
|
||||||
$this->setFood($food);
|
$this->setFood(max($food, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user