Fixed /Addxp on all skills not working properly

It was broken because of one of the previous commits
This commit is contained in:
bm01 2013-02-03 13:56:47 +01:00
parent 1dbe56b026
commit ecf32da760

View File

@ -45,10 +45,12 @@ public class AddxpCommand implements CommandExecutor {
profile = mcMMOPlayer.getProfile();
if (skill.equals(SkillType.ALL)) {
for (SkillType skillType : SkillType.values()) {
if (!skillType.isChildSkill()) {
mcMMOPlayer.applyXpGain(skill, xp);
for (SkillType type : SkillType.values()) {
if (type.equals(SkillType.ALL) || type.isChildSkill()) {
continue;
}
mcMMOPlayer.applyXpGain(type, xp);
}
sender.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", xp));
@ -104,11 +106,22 @@ public class AddxpCommand implements CommandExecutor {
profile.save(); // Since this is a temporary profile, we save it here.
}
else {
if (skill.equals(SkillType.ALL)) {
for (SkillType type : SkillType.values()) {
if (type.equals(SkillType.ALL) || type.isChildSkill()) {
continue;
}
mcMMOPlayer.applyXpGain(type, xp);
}
}
else {
mcMMOPlayer.applyXpGain(skill, xp);
}
modifiedPlayer = mcMMOPlayer.getPlayer();
profile = mcMMOPlayer.getProfile();
if (modifiedPlayer.isOnline()) {
if (skill.equals(SkillType.ALL)) {