aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/slayer
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-11 15:57:08 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-11 15:57:08 +0200
commit097f314f95960c565f076d76f176721fa7c8c445 (patch)
tree35baf4356647c217a885775efb9d6a4c0e16ff1f /src/main/java/at/hannibal2/skyhanni/features/slayer
parent50b6ab01efa1228a7b3ac37ad7c1447f885da775 (diff)
downloadskyhanni-097f314f95960c565f076d76f176721fa7c8c445.tar.gz
skyhanni-097f314f95960c565f076d76f176721fa7c8c445.tar.bz2
skyhanni-097f314f95960c565f076d76f176721fa7c8c445.zip
Fixed slayer profit tracker showing bz/ah price as npc price.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/slayer')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt
index a4d18aaa9..cd286beab 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt
@@ -14,7 +14,6 @@ import at.hannibal2.skyhanni.events.SackChangeEvent
import at.hannibal2.skyhanni.events.SlayerChangeEvent
import at.hannibal2.skyhanni.events.SlayerQuestCompleteEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData
-import at.hannibal2.skyhanni.features.bazaar.BazaarData
import at.hannibal2.skyhanni.test.PriceSource
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull
import at.hannibal2.skyhanni.utils.ItemUtils.name
@@ -24,8 +23,8 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.LorenzUtils.addSelector
import at.hannibal2.skyhanni.utils.LorenzUtils.sortedDesc
import at.hannibal2.skyhanni.utils.NEUInternalName
-import at.hannibal2.skyhanni.utils.NEUItems.getNpcPrice
-import at.hannibal2.skyhanni.utils.NEUItems.getPrice
+import at.hannibal2.skyhanni.utils.NEUItems.getNpcPriceOrNull
+import at.hannibal2.skyhanni.utils.NEUItems.getPriceOrNull
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
@@ -344,14 +343,11 @@ object SlayerItemProfitTracker {
list.slayerCompletedCount = 0
}
- private fun getPrice(internalName: NEUInternalName) =
- internalName.getBazaarData()?.let { getPrice(internalName, it) } ?: internalName.getPrice()
+ private fun getPrice(internalName: NEUInternalName) = when (config.priceFrom) {
+ 0 -> internalName.getBazaarData()?.sellPrice ?: internalName.getPriceOrNull() ?: 0.0
+ 1 -> internalName.getBazaarData()?.buyPrice ?: internalName.getPriceOrNull() ?: 0.0
- private fun getPrice(internalName: NEUInternalName, bazaarData: BazaarData) = when (config.priceFrom) {
- 0 -> bazaarData.sellPrice
- 1 -> bazaarData.buyPrice
-
- else -> internalName.getNpcPrice()
+ else -> internalName.getNpcPriceOrNull() ?: 0.0
}
@SubscribeEvent