mirror of
https://github.com/Anime-Game-Servers/Grasscutter-Quests.git
synced 2024-11-23 04:29:42 +00:00
[Fix] Fixed dungeon spawn position using BeginPos instead of BornPos
This commit is contained in:
parent
ec326ff562
commit
2cfb63ea28
@ -2,7 +2,9 @@ package emu.grasscutter.command.commands;
|
||||
|
||||
import emu.grasscutter.command.Command;
|
||||
import emu.grasscutter.command.CommandHandler;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import lombok.val;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -20,7 +22,12 @@ public final class EnterDungeonCommand implements CommandHandler {
|
||||
|
||||
try {
|
||||
int dungeonId = Integer.parseInt(args.get(0));
|
||||
if (dungeonId == targetPlayer.getSceneId()) {
|
||||
val dungeonData = GameData.getDungeonDataMap().get(dungeonId);
|
||||
if(dungeonData == null) {
|
||||
CommandHandler.sendMessage(sender, translate(sender, "commands.enter_dungeon.not_found_error"));
|
||||
return;
|
||||
}
|
||||
if (dungeonData.getSceneId() == targetPlayer.getSceneId() && targetPlayer.getScene().getCurDungeonId() == dungeonId) {
|
||||
CommandHandler.sendMessage(sender, translate(sender, "commands.enter_dungeon.in_dungeon_error"));
|
||||
return;
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ public class Scene {
|
||||
}
|
||||
|
||||
private Position getDefaultLocation(Player player) {
|
||||
val bornPost = this.scriptManager.getConfig().getBeginPos();
|
||||
val bornPost = this.scriptManager.getConfig().getBornPos();
|
||||
return bornPost != null ? new Position(bornPost) : player.getPosition();
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,7 @@ public class World implements Iterable<Player> {
|
||||
// }
|
||||
val config = newScene.getScriptManager().getConfig();
|
||||
if (teleportProperties.getTeleportTo() == null && config != null) {
|
||||
Optional.ofNullable(config.getBeginPos()).map(Position::new).ifPresent(teleportProperties::setTeleportTo);
|
||||
Optional.ofNullable(config.getBornPos()).map(Position::new).ifPresent(teleportProperties::setTeleportTo);
|
||||
Optional.ofNullable(config.getBornRot()).map(Position::new).ifPresent(teleportProperties::setTeleportRot);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user