From d67ebf595c7a7f62ae103a384c90f9ca73f5e05e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:43:17 +0100 Subject: Fix: Slayer cost from bank counting wrong (#1220) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main') 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()) } } -- cgit