Fix crash on login if the player didnt have a TowerManager

This commit is contained in:
Melledy 2022-05-06 19:12:54 -07:00
parent 1ed0511cd7
commit f894b96edf

View File

@ -144,6 +144,7 @@ public class Player {
this.avatars = new AvatarStorage(this); this.avatars = new AvatarStorage(this);
this.friendsList = new FriendsList(this); this.friendsList = new FriendsList(this);
this.mailHandler = new MailHandler(this); this.mailHandler = new MailHandler(this);
this.towerManager = new TowerManager(this);
this.pos = new Position(); this.pos = new Position();
this.rotation = new Position(); this.rotation = new Position();
this.properties = new HashMap<>(); this.properties = new HashMap<>();
@ -190,7 +191,6 @@ public class Player {
this.nickname = "Traveler"; this.nickname = "Traveler";
this.signature = ""; this.signature = "";
this.teamManager = new TeamManager(this); this.teamManager = new TeamManager(this);
this.towerManager = new TowerManager(this);
this.birthday = new PlayerBirthday(); this.birthday = new PlayerBirthday();
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);
@ -1099,9 +1099,6 @@ public class Player {
if (this.getProfile().getUid() == 0) { if (this.getProfile().getUid() == 0) {
this.getProfile().syncWithCharacter(this); this.getProfile().syncWithCharacter(this);
} }
if (this.getTowerManager() == null) {
this.towerManager = new TowerManager(this);
}
// Check if player object exists in server // Check if player object exists in server
// TODO - optimize // TODO - optimize