mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2024-11-23 04:19:43 +00:00
Fix setPrevScene bug (#2396)
This commit is contained in:
parent
9a198bd231
commit
d32a75e980
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user