mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-24 17:53:52 +08:00
Add the dungeon ID to the transfer scene packet
This commit is contained in:
parent
935de3f8e7
commit
24ad6bf478
@ -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
|
||||
|
@ -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;
|
||||
|
@ -100,6 +100,10 @@ public class PacketPlayerEnterSceneNotify extends BasePacket {
|
||||
+ "-"
|
||||
+ 18402);
|
||||
|
||||
if (teleportProperties.getDungeonId() != 0) {
|
||||
proto.setDungeonId(teleportProperties.getDungeonId());
|
||||
}
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user