Commit c8a7aea7 authored by ShiroSaki's avatar ShiroSaki Committed by Melledy
Browse files

Fix new account can't load codex datas

parent 9e8b6eff
...@@ -187,7 +187,7 @@ public class Player { ...@@ -187,7 +187,7 @@ public class Player {
this.birthday = new PlayerBirthday(); this.birthday = new PlayerBirthday();
this.rewardedLevels = new HashSet<>(); this.rewardedLevels = new HashSet<>();
this.moonCardGetTimes = new HashSet<>(); this.moonCardGetTimes = new HashSet<>();
this.codex = new PlayerCodex(); this.codex = new PlayerCodex(this);
this.shopLimit = new ArrayList<>(); this.shopLimit = new ArrayList<>();
this.expeditionInfo = new HashMap<>(); this.expeditionInfo = new HashMap<>();
...@@ -208,7 +208,7 @@ public class Player { ...@@ -208,7 +208,7 @@ public class Player {
this.signature = ""; this.signature = "";
this.teamManager = new TeamManager(this); this.teamManager = new TeamManager(this);
this.birthday = new PlayerBirthday(); this.birthday = new PlayerBirthday();
this.codex = new PlayerCodex(); this.codex = new PlayerCodex(this);
this.setProperty(PlayerProperty.PROP_PLAYER_LEVEL, 1); this.setProperty(PlayerProperty.PROP_PLAYER_LEVEL, 1);
this.setProperty(PlayerProperty.PROP_IS_SPRING_AUTO_USE, 1); this.setProperty(PlayerProperty.PROP_IS_SPRING_AUTO_USE, 1);
this.setProperty(PlayerProperty.PROP_SPRING_AUTO_USE_PERCENT, 50); this.setProperty(PlayerProperty.PROP_SPRING_AUTO_USE_PERCENT, 50);
...@@ -1174,6 +1174,9 @@ public class Player { ...@@ -1174,6 +1174,9 @@ public class Player {
if (this.getTeamManager() == null) { if (this.getTeamManager() == null) {
this.teamManager = new TeamManager(this); this.teamManager = new TeamManager(this);
} }
if (this.getCodex() == null) {
this.codex = new PlayerCodex(this);
}
if (this.getProfile().getUid() == 0) { if (this.getProfile().getUid() == 0) {
this.getProfile().syncWithCharacter(this); this.getProfile().syncWithCharacter(this);
} }
......
...@@ -39,6 +39,11 @@ public class PlayerCodex { ...@@ -39,6 +39,11 @@ public class PlayerCodex {
this.unlockedReliquarySuitCodex = new HashSet<>(); this.unlockedReliquarySuitCodex = new HashSet<>();
} }
public PlayerCodex(Player player){
this();
this.player = player;
}
public void setPlayer(Player player) { public void setPlayer(Player player) {
this.player = player; this.player = player;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment