From fdb8fec242f5b87bbd464ed95708d72391fe6d9b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 24 Dec 2023 17:09:50 +0100 Subject: Fixed percent to tier broken icon in bestiary display when bestiary is maxed. --- src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt index b269e1df2..5a5ad06f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt @@ -464,7 +464,8 @@ object BestiaryData { fun percentToMaxFormatted() = LorenzUtils.formatPercentage(percentToMax()) - fun percentToTier() = currentKillToNextLevel.toDouble() / killNeededForNextLevel + fun percentToTier() = + if (killNeededForNextLevel == 0L) 1.0 else currentKillToNextLevel.toDouble() / killNeededForNextLevel fun percentToTierFormatted() = LorenzUtils.formatPercentage(percentToTier()) -- cgit