Fix a rare issue with getting stuck in a loading screen

This commit is contained in:
Melledy
2024-04-02 16:07:59 -07:00
parent 40b2f5cebf
commit 37f297a22b

View File

@@ -838,6 +838,13 @@ public class Player implements Tickable {
this.enterScene(GameConstants.START_ENTRY_ID, 0, false); 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 // Send welcome mail after we load managers from the database
if (this.isNew) { if (this.isNew) {
this.getMailbox().sendWelcomeMail(); this.getMailbox().sendWelcomeMail();