diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-17 00:43:08 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-17 00:43:08 +0200 |
commit | 73f2a917fa822f176ab34eb2e6ab38d5b2584e9e (patch) | |
tree | 26da44ceb1f04456c41955209706d97b6972d225 /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | 420b43c2ac553d1c99b10bd1d5aba948c12bd803 (diff) | |
download | skyhanni-73f2a917fa822f176ab34eb2e6ab38d5b2584e9e.tar.gz skyhanni-73f2a917fa822f176ab34eb2e6ab38d5b2584e9e.tar.bz2 skyhanni-73f2a917fa822f176ab34eb2e6ab38d5b2584e9e.zip |
added more debug into for farming weight duration NaN error
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt index 9d09880e3..535163f81 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt @@ -309,7 +309,19 @@ object FarmingWeightDisplay { } val timeFormat = if (weightPerSecond != -1.0) { - val timeTillOvertake = (weightUntilOvertake / weightPerSecond).minutes + val timeTillOvertake = try { + (weightUntilOvertake / weightPerSecond).minutes + } catch (e: Exception) { + ErrorManager.logErrorWithData( + e, + "Error calculating Farming ETA duration", + "weightPerSecond" to weightPerSecond, + "weightUntilOvertake" to weightUntilOvertake, + "totalWeight" to totalWeight, + "nextPlayer.weight" to nextPlayer.weight, + ) + return null + } val format = timeTillOvertake.format() " §7(§b$format§7)" } else "" |