Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hannibal002 committed Nov 1, 2024
1 parent b01a485 commit 8ddb3d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import kotlin.time.Duration.Companion.seconds
@SkyHanniModule
object SkillAPI {
private val patternGroup = RepoPattern.group("api.skilldisplay")
// TODO add regex tests
private val skillPercentPattern by patternGroup.pattern(
"skill.percent",
"\\+(?<gained>[\\d.,]+) (?<skillName>.+) \\((?<progress>[\\d.]+)%\\)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ object SkillUtil {
var overflowXp = 0L

if (level >= maxLevel) {
val xpNeeded = when (maxSkillCap) {
50 -> XP_NEEDED_FOR_50
else -> XP_NEEDED_FOR_60
}
val xpNeeded = if (maxSkillCap == 50) XP_NEEDED_FOR_50 else XP_NEEDED_FOR_60

if (currentXp >= xpNeeded) {
overflowXp = currentXp - xpNeeded
Expand Down

0 comments on commit 8ddb3d4

Please sign in to comment.