From ab5e4fcdb412fd4a0a97245aa041edb1291f2e41 Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Fri, 13 May 2022 16:35:03 -0700 Subject: [PATCH] Use scene types instead of hardcoding scene ids for checking enter reason --- src/main/java/emu/grasscutter/game/world/World.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/world/World.java b/src/main/java/emu/grasscutter/game/world/World.java index 22048077d..ccbe4b841 100644 --- a/src/main/java/emu/grasscutter/game/world/World.java +++ b/src/main/java/emu/grasscutter/game/world/World.java @@ -10,6 +10,7 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player.SceneLoadState; import emu.grasscutter.game.props.EnterReason; import emu.grasscutter.game.props.EntityIdType; +import emu.grasscutter.game.props.SceneType; import emu.grasscutter.data.GameData; import emu.grasscutter.data.def.DungeonData; import emu.grasscutter.data.def.SceneData; @@ -267,11 +268,9 @@ public class World implements Iterable { enterReason = EnterReason.DungeonEnter; } else if (oldScene == newScene) { enterType = EnterType.ENTER_GOTO; - } - - // Home - if (2001 <= newScene.getId() && newScene.getId() <= 2004) { - enterType = EnterType.ENTER_SELF_HOME; + } else if (newScene.getSceneType() == SceneType.SCENE_HOME_WORLD) { + // Home + enterType = EnterType.ENTER_SELF_HOME; } // Teleport packet