mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-07-14 00:15:06 +00:00
Handle int overflow in SetExpFix
This commit is contained in:
parent
4d4779ecdc
commit
4dc2e2e3fd
|
@ -67,6 +67,10 @@ public class SetExpFix
|
|||
exp += getExpAtLevel(currentLevel);
|
||||
currentLevel++;
|
||||
}
|
||||
if (exp < 0)
|
||||
{
|
||||
exp = Integer.MAX_VALUE;
|
||||
}
|
||||
return exp;
|
||||
}
|
||||
|
||||
|
@ -82,6 +86,10 @@ public class SetExpFix
|
|||
currentLevel--;
|
||||
exp += getExpAtLevel(currentLevel);
|
||||
}
|
||||
if (exp < 0)
|
||||
{
|
||||
exp = Integer.MAX_VALUE;
|
||||
}
|
||||
return exp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue