And this is why we need unit tests...

This commit is contained in:
Eric Stokes 2011-10-03 19:40:21 -06:00
parent 86d3628b1c
commit 6e7daf4e85

View File

@ -749,13 +749,15 @@ public class MVWorld {
int diff = Integer.parseInt(difficulty); int diff = Integer.parseInt(difficulty);
if (diff >= 0 && diff <= 3) { if (diff >= 0 && diff <= 3) {
worlddiff = Difficulty.getByValue(diff); worlddiff = Difficulty.getByValue(diff);
} else {
return false;
} }
} catch (Exception e2) { } catch (Exception e2) {
return false; return false;
} }
} }
this.getCBWorld().setDifficulty(worlddiff); this.getCBWorld().setDifficulty(worlddiff);
config.setProperty("worlds." + this.name + ".difficulty", worlddiff); config.setProperty("worlds." + this.name + ".difficulty", worlddiff.getValue());
saveConfig(); saveConfig();
return true; return true;
} }