aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-05-09 05:09:30 +1000
committerGitHub <noreply@github.com>2024-05-08 21:09:30 +0200
commit6e1649d2b4b386f4ee5ead84caf378c4f5bdbdd7 (patch)
treea72bf72e9bd247d48f2f3d8257058cb7fb873597 /src/main/java/at
parent91e307ddf74559350bd6d6851b681c66f90d8d2a (diff)
downloadskyhanni-6e1649d2b4b386f4ee5ead84caf378c4f5bdbdd7.tar.gz
skyhanni-6e1649d2b4b386f4ee5ead84caf378c4f5bdbdd7.tar.bz2
skyhanni-6e1649d2b4b386f4ee5ead84caf378c4f5bdbdd7.zip
Fix: Upgrade warning showing when no upgrade possible (#1741)
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateAmount.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateAmount.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateAmount.kt
index 053af704b..e52fcdacb 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateAmount.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateAmount.kt
@@ -64,12 +64,13 @@ enum class ChocolateAmount(val chocolate: () -> Long) {
it.currentChocolate += amount
it.chocolateThisPrestige += amount
it.chocolateAllTime += amount
- updateBestUpgrade(amount)
+ updateBestUpgrade()
}
}
- private fun updateBestUpgrade(price: Long) {
+ private fun updateBestUpgrade() {
profileStorage?.let {
+ if (it.bestUpgradeAvailableAt == 0L || it.bestUpgradeCost == 0L) return
val canAffordAt = SimpleTimeMark.now() + CURRENT.timeUntilGoal(it.bestUpgradeCost)
it.bestUpgradeAvailableAt = canAffordAt.toMillis()
}