diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-24 15:30:45 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-24 15:30:45 +0200 |
commit | 3ef22687c728ac77235c6f48ef55479d909962f5 (patch) | |
tree | e8ca0d0579d5aa234af64f4599eadd02d0ef306c /src/main/java/at/hannibal2/skyhanni/features | |
parent | 762da98001bf62054fa662066800c86c839f44f7 (diff) | |
download | skyhanni-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.kt | 10 |
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" } |