Skip to content

Commit

Permalink
Fix a rare issue with getting stuck in a loading screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Apr 2, 2024
1 parent 40b2f5c commit 37f297a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/emu/lunarcore/game/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,13 @@ public void onLogin() {
this.enterScene(GameConstants.START_ENTRY_ID, 0, false);
}

// Sanity check lineup to prevent the player from getting stuck in a loading screen if they loaded into the game with an avatar that had 0 hp
var leader = this.getCurrentLeaderAvatar();
if (leader != null && leader.getCurrentHp(this.getCurrentLineup()) <= 0) {
leader.setCurrentHp(this.getCurrentLineup(), 2000);
leader.save();
}

// Send welcome mail after we load managers from the database
if (this.isNew) {
this.getMailbox().sendWelcomeMail();
Expand Down

0 comments on commit 37f297a

Please sign in to comment.