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
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
3 changed files with 11 additions and 3 deletions

View File

@ -275,14 +275,17 @@ public class World implements Iterable<Player> {
.teleportType(teleportType)
.enterReason(enterReason)
.teleportTo(teleportTo)
.enterType(EnterType.ENTER_TYPE_JUMP);
.enterType(EnterType.ENTER_TYPE_GOTO);
val sceneData = GameData.getSceneDataMap().get(sceneId);
if (dungeonData != null) {
teleportProps
.teleportTo(dungeonData.getStartPosition())
.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) {
teleportProps.enterType(EnterType.ENTER_TYPE_GOTO);
} 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());
newScene.addPlayer(player);
player.setAvatarsAbilityForScene(newScene);
player.getTeamManager().applyAbilities(newScene);
// Dungeon
// Dungeon system is handling this already

View File

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

View File

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