Fix error when logging on a fresh account

This commit is contained in:
Melledy
2025-11-19 04:58:01 -08:00
parent 51c12db822
commit e1c7ae57e3
2 changed files with 8 additions and 2 deletions

View File

@@ -172,9 +172,16 @@ public class Player implements GameDatabaseObject {
public void setSession(GameSession session) { public void setSession(GameSession session) {
if (this.session != null) { if (this.session != null) {
// Sanity check
if (this.session == session) {
return;
}
// Clear player from session
this.session.clearPlayer(); this.session.clearPlayer();
} }
// Set session
this.session = session; this.session = session;
} }

View File

@@ -136,8 +136,7 @@ public class PlayerModule extends GameContextModule {
// Put in player cache // Put in player cache
this.addToCache(player); this.addToCache(player);
// Set player for session System.out.println("created player");
session.setPlayer(player);
return player; return player;
} }