mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-10 10:20:44 -07:00
Fix xpglobes crash on level 99
This commit is contained in:
parent
70a79c3785
commit
1a3e92c0c3
1 changed files with 6 additions and 1 deletions
|
|
@ -27,6 +27,10 @@ object XPTable {
|
||||||
var lowIndex = 0
|
var lowIndex = 0
|
||||||
var highIndex = xpTable.size - 1
|
var highIndex = xpTable.size - 1
|
||||||
|
|
||||||
|
if (xp >= xpTable[highIndex]) {
|
||||||
|
return Pair(Constants.MAX_LEVEL, xp - xpTable[highIndex]) // Level is max or above, return the highest level
|
||||||
|
}
|
||||||
|
|
||||||
while (lowIndex <= highIndex) {
|
while (lowIndex <= highIndex) {
|
||||||
val midIndex = (lowIndex + highIndex) / 2
|
val midIndex = (lowIndex + highIndex) / 2
|
||||||
when {
|
when {
|
||||||
|
|
@ -40,6 +44,7 @@ object XPTable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Pair(Constants.INVALID_LEVEL, 0) // If xp is above all defined levels
|
return Pair(Constants.INVALID_LEVEL, 0) // If xp is below all defined levels
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue