Add the dungeon ID to the transfer scene packet

This commit is contained in:
KingRainbow44
2023-05-07 02:56:40 -04:00
parent 935de3f8e7
commit 24ad6bf478
3 changed files with 11 additions and 3 deletions

View File

@@ -275,14 +275,17 @@ public class World implements Iterable<Player> {
.teleportType(teleportType) .teleportType(teleportType)
.enterReason(enterReason) .enterReason(enterReason)
.teleportTo(teleportTo) .teleportTo(teleportTo)
.enterType(EnterType.ENTER_TYPE_JUMP); .enterType(EnterType.ENTER_TYPE_GOTO);
val sceneData = GameData.getSceneDataMap().get(sceneId); val sceneData = GameData.getSceneDataMap().get(sceneId);
if (dungeonData != null) { if (dungeonData != null) {
teleportProps teleportProps
.teleportTo(dungeonData.getStartPosition()) .teleportTo(dungeonData.getStartPosition())
.teleportRot(dungeonData.getStartRotation()); .teleportRot(dungeonData.getStartRotation());
teleportProps.enterType(EnterType.ENTER_TYPE_DUNGEON).enterReason(EnterReason.DungeonEnter); teleportProps
.enterType(EnterType.ENTER_TYPE_DUNGEON)
.enterReason(EnterReason.DungeonEnter);
teleportProps.dungeonId(dungeonData.getId());
} else if (player.getSceneId() == sceneId) { } else if (player.getSceneId() == sceneId) {
teleportProps.enterType(EnterType.ENTER_TYPE_GOTO); teleportProps.enterType(EnterType.ENTER_TYPE_GOTO);
} else if (sceneData != null && sceneData.getSceneType() == SceneType.SCENE_HOME_WORLD) { } else if (sceneData != null && sceneData.getSceneType() == SceneType.SCENE_HOME_WORLD) {
@@ -326,7 +329,7 @@ public class World implements Iterable<Player> {
var newScene = this.getSceneById(teleportProperties.getSceneId()); var newScene = this.getSceneById(teleportProperties.getSceneId());
newScene.addPlayer(player); newScene.addPlayer(player);
player.setAvatarsAbilityForScene(newScene); player.getTeamManager().applyAbilities(newScene);
// Dungeon // Dungeon
// Dungeon system is handling this already // Dungeon system is handling this already

View File

@@ -11,6 +11,7 @@ import lombok.Data;
@Builder @Builder
public class TeleportProperties { public class TeleportProperties {
private final int sceneId; private final int sceneId;
@Builder.Default private final int dungeonId = 0;
private final PlayerTeleportEvent.TeleportType teleportType; private final PlayerTeleportEvent.TeleportType teleportType;
private final EnterReason enterReason; private final EnterReason enterReason;
private Position teleportTo; private Position teleportTo;

View File

@@ -100,6 +100,10 @@ public class PacketPlayerEnterSceneNotify extends BasePacket {
+ "-" + "-"
+ 18402); + 18402);
if (teleportProperties.getDungeonId() != 0) {
proto.setDungeonId(teleportProperties.getDungeonId());
}
this.setData(proto); this.setData(proto);
} }
} }