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 --- .../at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt index 62cc85eae..9205b0154 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.afterChange import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy +import at.hannibal2.skyhanni.utils.NEUItems.getNpcPriceOrNull import at.hannibal2.skyhanni.utils.NEUItems.getPrice import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.format @@ -119,12 +120,13 @@ class EnderNodeTracker { 10_000.0 } else { val internalName = key.internalName - val bzData = internalName.getBazaarData() - if (LorenzUtils.noTradeMode) { - bzData?.npcPrice ?: georgePrice(key) ?: 0.0 + val npcPrice = internalName.getNpcPriceOrNull() + val bazaarData = internalName.getBazaarData() + if (LorenzUtils.noTradeMode || bazaarData == null) { + npcPrice ?: georgePrice(key) ?: 0.0 } else { - bzData?.npcPrice - ?.coerceAtLeast(bzData.sellPrice) + npcPrice + ?.coerceAtLeast(bazaarData.sellPrice) ?.coerceAtLeast(georgePrice(key) ?: 0.0) ?: internalName.getPrice() } -- cgit