From d32a75e980ace1a10e46aeb1e1e03db37edc3f17 Mon Sep 17 00:00:00 2001 From: Nazrin Date: Fri, 6 Oct 2023 21:40:36 -0700 Subject: [PATCH] Fix setPrevScene bug (#2396) --- .../server/packet/recv/HandlerPersonalSceneJumpReq.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerPersonalSceneJumpReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerPersonalSceneJumpReq.java index 469bcbadb..15e578183 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerPersonalSceneJumpReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerPersonalSceneJumpReq.java @@ -15,10 +15,11 @@ public class HandlerPersonalSceneJumpReq extends PacketHandler { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { PersonalSceneJumpReq req = PersonalSceneJumpReq.parseFrom(payload); var player = session.getPlayer(); + var prevSceneId = player.getSceneId(); // get the scene point ScenePointEntry scenePointEntry = - GameData.getScenePointEntryById(player.getSceneId(), req.getPointId()); + GameData.getScenePointEntryById(prevSceneId, req.getPointId()); if (scenePointEntry != null) { Position pos = @@ -26,6 +27,7 @@ public class HandlerPersonalSceneJumpReq extends PacketHandler { int sceneId = scenePointEntry.getPointData().getTranSceneId(); player.getWorld().transferPlayerToScene(player, sceneId, pos); + player.getScene().setPrevScene(prevSceneId); session.send(new PacketPersonalSceneJumpRsp(sceneId, pos)); } }