Skip to content

Commit

Permalink
Unstuck players if they login to raid scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Dec 24, 2023
1 parent 5ed1941 commit 76dc796
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/emu/lunarcore/game/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -779,11 +779,17 @@ public void onLogin() {
// Delete instance if it failed to validate (example: missing an excel)
this.challengeInstance = null;
}


// Unstuck check, dont load player into raid scenes
MazePlaneExcel planeExcel = GameData.getMazePlaneExcelMap().get(planeId);
if (planeExcel == null || planeExcel.getPlaneType().getVal() >= PlaneType.Raid.getVal()) {
this.resetPosition();
}

// Load into saved scene (should happen after everything else loads)
this.loadScene(planeId, floorId, entryId, this.getPos(), this.getRot(), false);

// Unstuck check in case we couldn't load the scene
// Reset position to starting scene in case we couldn't load the scene
if (this.getScene() == null) {
this.enterScene(GameConstants.START_ENTRY_ID, 0, false);
}
Expand Down

0 comments on commit 76dc796

Please sign in to comment.