diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt index 10c2f0bd6..c31135431 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt @@ -35,7 +35,7 @@ class FrozenTreasureTracker { private var treasureCount = mapOf<FrozenTreasure, Int>() init { - fixedRateTimer(name = "skyhanni-dungeon-milestone-display", period = 15_000) { + fixedRateTimer(name = "skyhanni-dungeon-milestone-display", period = 1000) { if (!onJerryWorkshop()) return@fixedRateTimer calculateIcePerHour() } @@ -52,9 +52,17 @@ class FrozenTreasureTracker { private fun calculateIcePerHour() { val difference = estimatedIce - lastEstimatedIce lastEstimatedIce = estimatedIce + + if (difference == estimatedIce) { + return + } + + icePerHour = icePerMin.average().toInt() * 3600 + icePerMin.add(difference) + if (difference == 0L) { stoppedChecks += 1 - if (stoppedChecks == 12) { + if (stoppedChecks == 60) { stoppedChecks = 0 icePerMin.clear() icePerHour = 0 @@ -62,8 +70,6 @@ class FrozenTreasureTracker { return } stoppedChecks = 0 - icePerMin.add(difference) - if (difference != estimatedIce) icePerHour = icePerMin.average().toInt() * 240 } private fun formatDisplay(map: List<List<Any>>): List<List<Any>> { |