mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-26 19:18:29 +01: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 New Issue
Block a user