summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2015-05-27 03:35:28 +0200
committerLane Kolbly <lane@rscheme.org>2015-06-10 01:23:57 +0200
commit73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44 (patch)
treeb4871bdf502c91912f99bb9ab00788e17bccd7ef /src/Entities/Player.cpp
parentMerge pull request #2221 from mc-server/AreaCountBlocks (diff)
downloadcuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.gz
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.bz2
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.lz
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.xz
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.zst
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index e3e3fac4f..0ca560d75 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1620,10 +1620,7 @@ void cPlayer::TossItems(const cItems & a_Items)
}
-
-
-
-bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
+bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition)
{
ASSERT(a_World != nullptr);
@@ -1653,6 +1650,8 @@ bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
SetWorldTravellingFrom(GetWorld()); // cChunk handles entity removal
GetWorld()->RemovePlayer(this, false);
+ SetPosition(a_NewPosition);
+
// Queue adding player to the new world, including all the necessary adjustments to the object
a_World->AddPlayer(this);
cWorld * OldWorld = cRoot::Get()->GetWorld(GetWorld()->GetName()); // Required for the hook HOOK_ENTITY_CHANGED_WORLD