Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
248b655f
Commit
248b655f
authored
May 13, 2022
by
Melledy
Browse files
Use scene types instead of hardcoding scene ids for checking enter reason
parent
82698d56
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/world/World.java
View file @
248b655f
...
...
@@ -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<Player> {
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment