From 1322f909f3bc83565edc46875ebe9ba8aa932d48 Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Mon, 18 Apr 2022 09:59:00 -0700 Subject: [PATCH] Simple sanity check when changing scenes --- src/main/java/emu/grasscutter/game/World.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/emu/grasscutter/game/World.java b/src/main/java/emu/grasscutter/game/World.java index e3eacf43e..31c4c9f2f 100644 --- a/src/main/java/emu/grasscutter/game/World.java +++ b/src/main/java/emu/grasscutter/game/World.java @@ -183,6 +183,10 @@ public class World implements Iterable { } public void transferPlayerToScene(GenshinPlayer player, int sceneId, Position pos) { + if (player.getScene().getId() == sceneId) { + return; + } + if (player.getScene() != null) { player.getScene().removePlayer(player); }