mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-04 23:37:49 +01:00
Have some idiot who gives 99999... (lots of 9 numbers)
This commit is contained in:
parent
40ace4f946
commit
e52e954843
@ -495,8 +495,9 @@ public class PlayerManager {
|
||||
*/
|
||||
public void addExperience(JobsPlayer jPlayer, Job job, double experience) {
|
||||
JobProgression prog = jPlayer.getJobProgression(job);
|
||||
if (prog == null)
|
||||
if (prog == null || experience > Double.MAX_VALUE)
|
||||
return;
|
||||
|
||||
int oldLevel = prog.getLevel();
|
||||
if (prog.addExperience(experience)) {
|
||||
performLevelUp(jPlayer, job, oldLevel);
|
||||
@ -514,8 +515,9 @@ public class PlayerManager {
|
||||
*/
|
||||
public void removeExperience(JobsPlayer jPlayer, Job job, double experience) {
|
||||
JobProgression prog = jPlayer.getJobProgression(job);
|
||||
if (prog == null)
|
||||
if (prog == null || experience > Double.MAX_VALUE)
|
||||
return;
|
||||
|
||||
prog.addExperience(-experience);
|
||||
|
||||
jPlayer.save();
|
||||
|
@ -32,14 +32,14 @@ public class removexp implements Cmd {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
||||
return true;
|
||||
}
|
||||
double xpLost;
|
||||
double xpLost = 0D;
|
||||
try {
|
||||
xpLost = Double.parseDouble(args[2]);
|
||||
} catch (Throwable e) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.admin.error"));
|
||||
return true;
|
||||
}
|
||||
if (xpLost <= 0) {
|
||||
if (xpLost <= 0 || xpLost > Double.MAX_VALUE) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.admin.error"));
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user