mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-11 17:15:07 +02:00
Handle int overflow in SetExpFix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user