aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-24 15:30:45 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-24 15:30:45 +0200
commit3ef22687c728ac77235c6f48ef55479d909962f5 (patch)
treee8ca0d0579d5aa234af64f4599eadd02d0ef306c /src/main/java/at/hannibal2/skyhanni/features
parent762da98001bf62054fa662066800c86c839f44f7 (diff)
downloadskyhanni-3ef22687c728ac77235c6f48ef55479d909962f5.tar.gz
skyhanni-3ef22687c728ac77235c6f48ef55479d909962f5.tar.bz2
skyhanni-3ef22687c728ac77235c6f48ef55479d909962f5.zip
Fixed error with detecting hit phase during eman slayer in damage indicator
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
index ece8bb32f..41d30a331 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -623,7 +623,15 @@ class DamageIndicatorManager {
else -> 100
}
val name = armorStandHits.name.removeColor()
- val hits = name.between("Seraph ", " Hit").toInt()
+
+ // TODO replace this super ugly workaround with regex
+ val text = name.between("Seraph ", " Hit")
+ val hits = try {
+ text.toInt()
+ } catch (e: NumberFormatException) {
+ text.substring(2).toInt()
+ }
+
return NumberUtil.percentageColor(hits.toLong(), maxHits.toLong()).getChatColor() + "$hits Hits"
}