diff options
Diffstat (limited to 'src/main')
-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() } |