Skip to content

Commit

Permalink
Fix: Negative price for items with no NPC sell price (hannibal002#2360)
Browse files Browse the repository at this point in the history
  • Loading branch information
qtlunya authored Aug 17, 2024
1 parent b09e626 commit 46dcf1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/utils/ItemPriceUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object ItemPriceUtils {
fun NEUInternalName.getPrice(
priceSource: ItemPriceSource = ItemPriceSource.BAZAAR_INSTANT_BUY,
pastRecipes: List<NeuRecipe> = emptyList(),
) = getPriceOrNull(priceSource, pastRecipes) ?: -1.0
) = getPriceOrNull(priceSource, pastRecipes) ?: 0.0

fun NEUInternalName.getPriceOrNull(
priceSource: ItemPriceSource = ItemPriceSource.BAZAAR_INSTANT_BUY,
Expand Down Expand Up @@ -66,7 +66,7 @@ object ItemPriceUtils {
.filter { it >= 0 }
.minOrNull()

fun NEUInternalName.getNpcPrice(): Double = getNpcPriceOrNull() ?: -1.0
fun NEUInternalName.getNpcPrice(): Double = getNpcPriceOrNull() ?: 0.0

fun NEUInternalName.getNpcPriceOrNull(): Double? {
if (this == NEUInternalName.WISP_POTION) {
Expand Down

0 comments on commit 46dcf1a

Please sign in to comment.