mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-13 04:45:02 +01:00
Fix error when logging on a fresh account
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user