diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-02 14:21:09 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-02 14:21:09 +0100 |
commit | 35d358151fdd3a344a28407a1da950d99f62675c (patch) | |
tree | 82c6ce7d46acccc222dc7f818136c5e56ab4dd54 /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | 017edfa6eaca6b682a68c16fc0a9c621ebaf1177 (diff) | |
download | skyhanni-35d358151fdd3a344a28407a1da950d99f62675c.tar.gz skyhanni-35d358151fdd3a344a28407a1da950d99f62675c.tar.bz2 skyhanni-35d358151fdd3a344a28407a1da950d99f62675c.zip |
Preparations
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt index b9fb4ee5f..a43f9671f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt @@ -140,7 +140,7 @@ class GardenVisitorFeatures { var totalPrice = 0.0 var amountDifferentItems = 0 var endReached = false - for ((i, l) in list.withIndex()) { + for ((i, l) in list.toMutableList().withIndex()) { val line = l.substring(4) if (line == "") { if (amountDifferentItems > 1) { @@ -153,9 +153,9 @@ class GardenVisitorFeatures { if (i > 1 && !endReached) { val (itemName, amount) = ItemUtils.readItemAmount(line) if (itemName != null) { - val lowestBin: Double + val internalName: String try { - lowestBin = NEUItems.getPrice(NEUItems.getInternalName(itemName)) + internalName = NEUItems.getInternalName(itemName) } catch (e: NullPointerException) { val message = "internal name is null: '$itemName'" println(message) @@ -163,7 +163,7 @@ class GardenVisitorFeatures { e.printStackTrace() return } - val price = lowestBin * amount + val price = NEUItems.getPrice(internalName) * amount totalPrice += price val format = NumberUtil.format(price) list[i] = "$line §7(§6$format§7)" |