Fixing no Xp gain from previous commit

This commit is contained in:
bm01 2013-02-02 05:06:47 +01:00
parent 2006356ccd
commit 610bc42815
2 changed files with 8 additions and 4 deletions

View File

@ -104,8 +104,10 @@ public class McMMOPlayer {
}
if (party != null && !ShareHandler.isRunning()) {
ShareHandler.handleEqualXpShare(xp, this, skillType);
return;
// Return if the Xp has been shared
if (ShareHandler.handleEqualXpShare(xp, this, skillType)) {
return;
}
}
if ((skillType.getMaxLevel() < profile.getSkillLevel(skillType) + 1) || (Misc.getPowerLevelCap() < getPowerLevel() + 1)) {

View File

@ -37,8 +37,9 @@ public final class ShareHandler {
* @param xp Xp without party sharing
* @param mcMMOPlayer Player initiating the Xp gain
* @param skillType Skill being used
* @return True is the xp has been shared
*/
public static void handleEqualXpShare(int xp, McMMOPlayer mcMMOPlayer, SkillType skillType) {
public static boolean handleEqualXpShare(int xp, McMMOPlayer mcMMOPlayer, SkillType skillType) {
running = true;
Party party = mcMMOPlayer.getParty();
@ -48,7 +49,7 @@ public final class ShareHandler {
if (nearMembers.isEmpty()) {
running = false;
return;
return false;
}
double partySize = nearMembers.size() + 1;
@ -63,6 +64,7 @@ public final class ShareHandler {
}
running = false;
return true;
}
public static boolean isRunning() {