浏览代码

Do not save an un-loaded PlayerProfile

riking 11 年之前
父节点
当前提交
77f9f40065
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java

+ 2 - 2
src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java

@@ -54,7 +54,7 @@ public class PlayerProfile {
      * Calling this constructor is considered loading the profile.
      */
     public PlayerProfile(String playerName, Map<SkillType, Integer> argSkills, Map<SkillType, Float> argSkillsXp, Map<AbilityType, Integer> argSkillsDats, MobHealthbarType mobHealthbarType) {
-        this(playerName, true);
+        this(playerName);
 
         this.mobHealthbarType = mobHealthbarType;
 
@@ -66,7 +66,7 @@ public class PlayerProfile {
     }
 
     public void save() {
-        if (!changed) {
+        if (!changed || !loaded) {
             return;
         }