mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +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();
|
||||
if($food > 0){
|
||||
$food--;
|
||||
$this->setFood($food);
|
||||
$this->setFood(max($food, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user