Skip to content

Commit

Permalink
Fix max barn space error (#2356)
Browse files Browse the repository at this point in the history
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
hannibal002 and hannibal002 authored Aug 16, 2024
1 parent 27b8ca2 commit a40a0f5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a40a0f5

Please sign in to comment.