Skip to content

Commit

Permalink
fix: pet level calculation out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Sychic committed Dec 19, 2023
1 parent f959005 commit 7e4c962
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/gg/skytils/skytilsmod/utils/SkillUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ object SkillUtils {
get () {
val offset = petRarityOffset[tier] ?: 0
val maxLevel = if (type == "GOLDEN_DRAGON") 200 else 100
val levels = petLevels.sliceArray(offset..< offset + maxLevel)
val levels = petLevels.sliceArray(offset..< offset + maxLevel - 1)

levels.reduceIndexed { index, acc, i ->
if (exp < acc) return index - 1
Expand Down

0 comments on commit 7e4c962

Please sign in to comment.