diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-08-16 11:17:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 11:17:31 +0200 |
commit | a40a0f52410d2caf5901c666431851640e0ba542 (patch) | |
tree | 0387f91d7cc8025e8d4eae84522386fe4808c81c /src/main/java/at | |
parent | 27b8ca2f81a6f9b7f99980236209acb5985a23b3 (diff) | |
download | skyhanni-a40a0f52410d2caf5901c666431851640e0ba542.tar.gz skyhanni-a40a0f52410d2caf5901c666431851640e0ba542.tar.bz2 skyhanni-a40a0f52410d2caf5901c666431851640e0ba542.zip |
Fix max barn space error (#2356)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt index 31762ab2e..20d752e35 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.features.event.hoppity.HoppityCollectionData import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsCompactChat import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -77,10 +78,14 @@ object ChocolateFactoryBarnManager { val profileStorage = profileStorage ?: return + // TODO rename maxRabbits to maxUnlockedBarnSpace if (profileStorage.maxRabbits >= ChocolateFactoryAPI.maxRabbits) return + // when the unlocked barn space has already surpassed the total amount of rabbits + val alreadyBigEnough = profileStorage.maxRabbits >= HoppityCollectionData.knownRabbitCount + val remainingSpace = profileStorage.maxRabbits - profileStorage.currentRabbits - barnFull = remainingSpace <= config.barnCapacityThreshold + barnFull = remainingSpace <= config.barnCapacityThreshold && !alreadyBigEnough if (!barnFull) return if (inventory && sentBarnFullWarning) return |