mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 05:26:50 +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 {
|
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
PersonalSceneJumpReq req = PersonalSceneJumpReq.parseFrom(payload);
|
PersonalSceneJumpReq req = PersonalSceneJumpReq.parseFrom(payload);
|
||||||
var player = session.getPlayer();
|
var player = session.getPlayer();
|
||||||
|
var prevSceneId = player.getSceneId();
|
||||||
|
|
||||||
// get the scene point
|
// get the scene point
|
||||||
ScenePointEntry scenePointEntry =
|
ScenePointEntry scenePointEntry =
|
||||||
GameData.getScenePointEntryById(player.getSceneId(), req.getPointId());
|
GameData.getScenePointEntryById(prevSceneId, req.getPointId());
|
||||||
|
|
||||||
if (scenePointEntry != null) {
|
if (scenePointEntry != null) {
|
||||||
Position pos =
|
Position pos =
|
||||||
@ -26,6 +27,7 @@ public class HandlerPersonalSceneJumpReq extends PacketHandler {
|
|||||||
int sceneId = scenePointEntry.getPointData().getTranSceneId();
|
int sceneId = scenePointEntry.getPointData().getTranSceneId();
|
||||||
|
|
||||||
player.getWorld().transferPlayerToScene(player, sceneId, pos);
|
player.getWorld().transferPlayerToScene(player, sceneId, pos);
|
||||||
|
player.getScene().setPrevScene(prevSceneId);
|
||||||
session.send(new PacketPersonalSceneJumpRsp(sceneId, pos));
|
session.send(new PacketPersonalSceneJumpRsp(sceneId, pos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user