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
3ae30e3c
Commit
3ae30e3c
authored
Apr 21, 2022
by
Melledy
Committed by
GitHub
Apr 21, 2022
Browse files
Merge pull request #87 from Yazawazi/development
Teleport Small Fix
parents
0e7976f9
069cb1c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/World.java
View file @
3ae30e3c
...
@@ -212,7 +212,10 @@ public class World implements Iterable<GenshinPlayer> {
...
@@ -212,7 +212,10 @@ public class World implements Iterable<GenshinPlayer> {
return
false
;
return
false
;
}
}
Integer
oldSceneId
=
null
;
if
(
player
.
getScene
()
!=
null
)
{
if
(
player
.
getScene
()
!=
null
)
{
oldSceneId
=
player
.
getScene
().
getId
();
player
.
getScene
().
removePlayer
(
player
);
player
.
getScene
().
removePlayer
(
player
);
}
}
...
@@ -221,7 +224,11 @@ public class World implements Iterable<GenshinPlayer> {
...
@@ -221,7 +224,11 @@ public class World implements Iterable<GenshinPlayer> {
player
.
getPos
().
set
(
pos
);
player
.
getPos
().
set
(
pos
);
// Teleport packet
// Teleport packet
player
.
sendPacket
(
new
PacketPlayerEnterSceneNotify
(
player
,
EnterType
.
EnterSelf
,
EnterReason
.
TransPoint
,
sceneId
,
pos
));
if
(
oldSceneId
.
equals
(
sceneId
))
{
player
.
sendPacket
(
new
PacketPlayerEnterSceneNotify
(
player
,
EnterType
.
EnterGoto
,
EnterReason
.
TransPoint
,
sceneId
,
pos
));
}
else
{
player
.
sendPacket
(
new
PacketPlayerEnterSceneNotify
(
player
,
EnterType
.
EnterJump
,
EnterReason
.
TransPoint
,
sceneId
,
pos
));
}
return
true
;
return
true
;
}
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java
View file @
3ae30e3c
...
@@ -52,7 +52,7 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
...
@@ -52,7 +52,7 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.
setSceneId
(
newScene
)
.
setSceneId
(
newScene
)
.
setPos
(
newPos
.
toProto
())
.
setPos
(
newPos
.
toProto
())
.
setSceneBeginTime
(
System
.
currentTimeMillis
())
.
setSceneBeginTime
(
System
.
currentTimeMillis
())
.
setType
(
EnterType
.
EnterSelf
)
.
setType
(
type
)
.
setTargetUid
(
target
.
getUid
())
.
setTargetUid
(
target
.
getUid
())
.
setEnterSceneToken
(
player
.
getEnterSceneToken
())
.
setEnterSceneToken
(
player
.
getEnterSceneToken
())
.
setWorldLevel
(
target
.
getWorld
().
getWorldLevel
())
.
setWorldLevel
(
target
.
getWorld
().
getWorldLevel
())
...
...
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