From b42d8b67edd116b8daa52cc62caedb16f75d63b6 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Wed, 12 Apr 2023 02:59:44 -0400 Subject: [PATCH] Fix quest progression when entering a domain --- .../packet/recv/HandlerPostEnterSceneReq.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerPostEnterSceneReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerPostEnterSceneReq.java index a75a9bd3a..8dcf92aef 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerPostEnterSceneReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerPostEnterSceneReq.java @@ -13,11 +13,20 @@ public class HandlerPostEnterSceneReq extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - if (session.getPlayer().getScene().getSceneType() == SceneType.SCENE_ROOM) { - session - .getPlayer() - .getQuestManager() - .queueEvent(QuestContent.QUEST_CONTENT_ENTER_ROOM, session.getPlayer().getSceneId(), 0); + var player = session.getPlayer(); + var scene = player.getScene(); + var questManager = player.getQuestManager(); + + switch (session.getPlayer().getScene().getSceneType()){ + case SCENE_ROOM -> questManager.queueEvent(QuestContent.QUEST_CONTENT_ENTER_ROOM, scene.getId(), 0); + case SCENE_WORLD -> { + questManager.queueEvent(QuestContent.QUEST_CONTENT_ENTER_MY_WORLD, scene.getId()); + questManager.queueEvent(QuestContent.QUEST_CONTENT_ENTER_MY_WORLD_SCENE, scene.getId()); + } + case SCENE_DUNGEON -> { + var dungeonManager = scene.getDungeonManager(); + if (dungeonManager != null) dungeonManager.startDungeon(); + } } session.send(new PacketPostEnterSceneRsp(session.getPlayer()));