From f599f1c2b983b1426e8c23dcb93505867fda448a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 15 Mar 2025 13:23:34 +0700 Subject: [PATCH] Fix saturation going negative --- src/main/kotlin/ru/dbotthepony/mc/otm/player/MatteryFoodData.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/player/MatteryFoodData.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/player/MatteryFoodData.kt index 62b9a8e82..9f442d2df 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/player/MatteryFoodData.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/player/MatteryFoodData.kt @@ -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)