From 7eb3e77e5ce50989af3cd4ab2b196fb0df76e168 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 28 Aug 2023 19:11:40 +0200 Subject: Removing npc price from bazaar data and Fixed multiple bugs with garden visitor --- .../skyhanni/features/bazaar/BazaarData.kt | 1 - .../skyhanni/features/bazaar/BazaarDataHolder.kt | 24 +++------------------- 2 files changed, 3 insertions(+), 22 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/bazaar') diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt index 3562be68a..daed03152 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt @@ -4,5 +4,4 @@ data class BazaarData( val displayName: String, val sellPrice: Double, val buyPrice: Double, - val npcPrice: Double, ) \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt index 039b57540..61f19a630 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt @@ -18,6 +18,8 @@ class BazaarDataHolder { companion object { private val bazaarData = mutableMapOf() private var npcPrices = mapOf() + + fun getNpcPrice(internalName: NEUInternalName) = npcPrices[internalName] } private fun loadNpcPrices(): MutableMap { @@ -66,29 +68,9 @@ class BazaarDataHolder { val displayName = stack.name!!.removeColor() val sellPrice = internalName.getPrice(true) val buyPrice = internalName.getPrice(false) - val npcPrice = npcPrices[internalName].let { - if (it == null) { - if (!ignoreNoNpcPrice(internalName)) { - LorenzUtils.debug("NPC price not found for '$internalName'") - } - 0.0 - } else it - } - val data = BazaarData(displayName, sellPrice, buyPrice, npcPrice) + val data = BazaarData(displayName, sellPrice, buyPrice) bazaarData[internalName] = data return data } - - private fun ignoreNoNpcPrice(internalName: NEUInternalName): Boolean { - if (internalName.startsWith("TURBO_")) return true - if (internalName.equals("PURPLE_CANDY")) return true - if (internalName.equals("JACOBS_TICKET")) return true - if (internalName.equals("RAW_SOULFLOW")) return true - if (internalName.equals("DERELICT_ASHE")) return true - - if (internalName.contains(";")) return true - - return false - } } \ No newline at end of file -- cgit