Fix saturation going negative

This commit is contained in:
DBotThePony 2025-03-15 13:23:34 +07:00
parent 962ecb1996
commit f599f1c2b9
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -79,7 +79,7 @@ class MatteryFoodData(private var player: Player) : FoodData() {
if (saturationLevel > 0f) { if (saturationLevel > 0f) {
val satisfied = min(saturationLevel.roundToInt(), points) val satisfied = min(saturationLevel.roundToInt(), points)
points -= satisfied points -= satisfied
saturationLevel -= satisfied saturationLevel = max(0f, saturationLevel - satisfied)
} }
foodLevel = max(0, foodLevel - points) foodLevel = max(0, foodLevel - points)