diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-05-09 05:09:30 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 21:09:30 +0200 |
commit | 6e1649d2b4b386f4ee5ead84caf378c4f5bdbdd7 (patch) | |
tree | a72bf72e9bd247d48f2f3d8257058cb7fb873597 /src/main/java/at | |
parent | 91e307ddf74559350bd6d6851b681c66f90d8d2a (diff) | |
download | skyhanni-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.kt | 5 |
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() } |