aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-17 00:43:08 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-17 00:43:08 +0200
commit73f2a917fa822f176ab34eb2e6ab38d5b2584e9e (patch)
tree26da44ceb1f04456c41955209706d97b6972d225
parent420b43c2ac553d1c99b10bd1d5aba948c12bd803 (diff)
downloadskyhanni-73f2a917fa822f176ab34eb2e6ab38d5b2584e9e.tar.gz
skyhanni-73f2a917fa822f176ab34eb2e6ab38d5b2584e9e.tar.bz2
skyhanni-73f2a917fa822f176ab34eb2e6ab38d5b2584e9e.zip
added more debug into for farming weight duration NaN error
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt14
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 ""