Fix saturation going negative
This commit is contained in:
parent
962ecb1996
commit
f599f1c2b9
@ -79,7 +79,7 @@ class MatteryFoodData(private var player: Player) : FoodData() {
|
||||
if (saturationLevel > 0f) {
|
||||
val satisfied = min(saturationLevel.roundToInt(), points)
|
||||
points -= satisfied
|
||||
saturationLevel -= satisfied
|
||||
saturationLevel = max(0f, saturationLevel - satisfied)
|
||||
}
|
||||
|
||||
foodLevel = max(0, foodLevel - points)
|
||||
|
Loading…
Reference in New Issue
Block a user