From 6e1649d2b4b386f4ee5ead84caf378c4f5bdbdd7 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Thu, 9 May 2024 05:09:30 +1000 Subject: Fix: Upgrade warning showing when no upgrade possible (#1741) --- .../skyhanni/features/inventory/chocolatefactory/ChocolateAmount.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/at') 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() } -- cgit