mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 21:34:35 +01:00
Fix train parlor map UI
This commit is contained in:
@@ -14,6 +14,7 @@ public class GameConstants {
|
||||
// Game
|
||||
public static final String DEFAULT_NAME = "A Nameless";
|
||||
public static final int[] DEFAULT_HEAD_ICONS = {208001, 208002};
|
||||
public static final int DEFAULT_WORLD_ID = 101;
|
||||
public static final int TRAILBLAZER_AVATAR_ID = 8001;
|
||||
public static final int MAX_TRAILBLAZER_LEVEL = 70;
|
||||
public static final int[] WORLD_LEVEL_UPGRADES = {0, 20, 30, 40, 50, 60, 65};
|
||||
|
||||
@@ -112,6 +112,7 @@ public class Player implements Tickable {
|
||||
private int planeId;
|
||||
private int floorId;
|
||||
private int entryId;
|
||||
private int worldId;
|
||||
|
||||
private long lastActiveTime;
|
||||
|
||||
@@ -800,6 +801,11 @@ public class Player implements Tickable {
|
||||
nextScene = new Scene(this, planeExcel, floorId);
|
||||
}
|
||||
|
||||
// Set world id
|
||||
if (planeExcel.getPlaneType() == PlaneType.Town || planeExcel.getPlaneType() == PlaneType.Maze) {
|
||||
this.worldId = planeExcel.getWorldID();
|
||||
}
|
||||
|
||||
// Set player position
|
||||
this.getPos().set(pos);
|
||||
this.getRot().set(rot);
|
||||
@@ -918,6 +924,11 @@ public class Player implements Tickable {
|
||||
this.challengeInstance = null;
|
||||
}
|
||||
|
||||
// Set default world id if we don't have it
|
||||
if (this.worldId == 0) {
|
||||
this.worldId = GameConstants.DEFAULT_WORLD_ID;
|
||||
}
|
||||
|
||||
// Unstuck check, dont load player into raid scenes
|
||||
MazePlaneExcel planeExcel = GameData.getMazePlaneExcelMap().get(planeId);
|
||||
if (planeExcel == null || planeExcel.getPlaneType().getVal() >= PlaneType.Raid.getVal()) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class Scene implements Tickable {
|
||||
private final int planeId;
|
||||
private final int floorId;
|
||||
private int entryId;
|
||||
private int worldId;
|
||||
@Setter private int leaveEntryId;
|
||||
|
||||
private int lastEntityId = 0;
|
||||
@@ -72,6 +73,13 @@ public class Scene implements Tickable {
|
||||
this.healingSprings = new ObjectArrayList<>();
|
||||
this.triggers = new ObjectArrayList<>();
|
||||
|
||||
// Set world id
|
||||
if (this.getExcel().getPlaneType() == PlaneType.Train) {
|
||||
this.worldId = player.getWorldId();
|
||||
} else {
|
||||
this.worldId = this.getExcel().getWorldID();
|
||||
}
|
||||
|
||||
// Use singleton to avoid allocating memory for a new entity loader everytime we create a scene
|
||||
this.entityLoader = getExcel().getPlaneType().getSceneEntityLoader();
|
||||
|
||||
@@ -394,7 +402,7 @@ public class Scene implements Tickable {
|
||||
|
||||
// Proto
|
||||
var proto = SceneInfo.newInstance()
|
||||
.setWorldId(this.getExcel().getWorldID())
|
||||
.setWorldId(this.getWorldId())
|
||||
.setGameModeType(this.getExcel().getPlaneType().getVal())
|
||||
.setPlaneId(this.getPlaneId())
|
||||
.setFloorId(this.getFloorId())
|
||||
|
||||
Reference in New Issue
Block a user