Fixed NPE with /mmoedit

This commit is contained in:
bm01
2012-06-12 22:51:57 +02:00
parent 89b5f8c275
commit 050b794b42
4 changed files with 34 additions and 65 deletions

View File

@ -63,10 +63,10 @@ public class PlayerProfile {
private String playerName;
private final static String location = mcMMO.usersFile;
public PlayerProfile(Player player, boolean addNew) {
public PlayerProfile(Player player, String playerName, boolean addNew) {
hud = SpoutConfig.getInstance().defaulthud;
this.player = player;
this.playerName = player.getName();
this.playerName = playerName;
party = PartyManager.getInstance().getPlayerParty(playerName);
@ -109,7 +109,7 @@ public class PlayerProfile {
public boolean loadMySQL() {
userid = mcMMO.database.getInt("SELECT id FROM " + Config.getInstance().getMySQLTablePrefix() + "users WHERE user = '" + playerName + "'");
if (userid <= 0) {
if (userid == 0) {
return false;
}
else {
@ -1067,8 +1067,6 @@ public class PlayerProfile {
skills.put(skillType, newValue);
skillsXp.put(skillType, 0);
}
save();
}
/**