summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2015-04-03 18:40:20 +0200
committerSTRWarrior <niels.breuker@hotmail.nl>2015-04-03 18:40:20 +0200
commit399392195ff236275c933735f4f885adababfb1b (patch)
tree6847c854696cdc922f1d711172bb18bb93691fed /src
parentMerge pull request #1826 from mc-server/UnifyPacketizer (diff)
downloadcuberite-399392195ff236275c933735f4f885adababfb1b.tar
cuberite-399392195ff236275c933735f4f885adababfb1b.tar.gz
cuberite-399392195ff236275c933735f4f885adababfb1b.tar.bz2
cuberite-399392195ff236275c933735f4f885adababfb1b.tar.lz
cuberite-399392195ff236275c933735f4f885adababfb1b.tar.xz
cuberite-399392195ff236275c933735f4f885adababfb1b.tar.zst
cuberite-399392195ff236275c933735f4f885adababfb1b.zip
Diffstat (limited to 'src')
-rw-r--r--src/Entities/Player.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index c89e7b87c..2549a8481 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1603,6 +1603,9 @@ bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
m_ClientHandle->SendRespawn(a_World->GetDimension());
}
+ // Broadcast for other people that the player is gone.
+ GetWorld()->BroadcastDestroyEntity(*this);
+
// Remove player from the old world
SetWorldTravellingFrom(GetWorld()); // cChunk handles entity removal
GetWorld()->RemovePlayer(this, false);
@@ -1619,6 +1622,9 @@ bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
{
m_ClientHandle->SendWeather(a_World->GetWeather());
}
+
+ // Broadcast the player into the new world.
+ a_World->BroadcastSpawnEntity(*this);
return true;
}