aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-03-21 16:43:17 +0100
committerGitHub <noreply@github.com>2024-03-21 16:43:17 +0100
commitd67ebf595c7a7f62ae103a384c90f9ca73f5e05e (patch)
tree456debfc1c9a9dfe7eb5755053bc49c86255230c /src/main
parentab5a856459afb7043b7784c0e67ddc6723969271 (diff)
downloadskyhanni-d67ebf595c7a7f62ae103a384c90f9ca73f5e05e.tar.gz
skyhanni-d67ebf595c7a7f62ae103a384c90f9ca73f5e05e.tar.bz2
skyhanni-d67ebf595c7a7f62ae103a384c90f9ca73f5e05e.zip
Fix: Slayer cost from bank counting wrong (#1220)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt
index 9a709e43b..c28441c33 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt
@@ -84,6 +84,7 @@ object SlayerProfitTracker {
private val ItemTrackerData.TrackedItem.timesDropped get() = timesGained
private fun addSlayerCosts(price: Double) {
+ require(price < 0) {"slayer costs can not be positve"}
getTracker()?.modify {
it.slayerSpawnCost += price.toInt()
}
@@ -112,7 +113,7 @@ object SlayerProfitTracker {
fun onChat(event: LorenzChatEvent) {
if (!isEnabled()) return
autoSlayerBankPattern.matchMatcher(event.message) {
- addSlayerCosts(group("coins").formatDouble())
+ addSlayerCosts(-group("coins").formatDouble())
}
}