summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-12 16:21:07 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-12 16:21:07 +0200
commit29567c56107c86b70da130f995564beb2eaf424c (patch)
treebe7b996042b28d8ebac0c7c665963d1d7e991600 /src/Entities/Player.cpp
parentMerge branch 'master' into portals (diff)
downloadcuberite-29567c56107c86b70da130f995564beb2eaf424c.tar
cuberite-29567c56107c86b70da130f995564beb2eaf424c.tar.gz
cuberite-29567c56107c86b70da130f995564beb2eaf424c.tar.bz2
cuberite-29567c56107c86b70da130f995564beb2eaf424c.tar.lz
cuberite-29567c56107c86b70da130f995564beb2eaf424c.tar.xz
cuberite-29567c56107c86b70da130f995564beb2eaf424c.tar.zst
cuberite-29567c56107c86b70da130f995564beb2eaf424c.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 4d6688694..a346e68cf 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -948,7 +948,7 @@ void cPlayer::Respawn(void)
m_LifetimeTotalXp = 0;
// ToDo: send score to client? How?
- m_ClientHandle->SendRespawn(*GetWorld());
+ m_ClientHandle->SendRespawn(GetWorld()->GetDimension());
// Extinguish the fire:
StopBurning();
@@ -1570,7 +1570,7 @@ void cPlayer::TossItems(const cItems & a_Items)
-bool cPlayer::MoveToWorld(const AString & a_WorldName, cWorld * a_World)
+bool cPlayer::MoveToWorld(const AString & a_WorldName, cWorld * a_World, bool a_ShouldSendRespawn)
{
cWorld * World;
if (a_World == NULL)
@@ -1589,31 +1589,22 @@ bool cPlayer::MoveToWorld(const AString & a_WorldName, cWorld * a_World)
if (GetWorld() == World)
{
+ // Don't move to same world
return false;
}
// Send the respawn packet:
- if (m_ClientHandle != NULL)
+ if (a_ShouldSendRespawn && (m_ClientHandle != NULL))
{
- m_ClientHandle->SendRespawn(*World);
+ m_ClientHandle->SendRespawn(World->GetDimension());
}
- // Remove all links to the old world
+ // Remove player from old world
m_World->RemovePlayer(this);
- // If the dimension is different, we can send the respawn packet
- // http://wiki.vg/Protocol#0x09 says "don't send if dimension is the same" as of 2013_07_02
-
// Queue adding player to the new world, including all the necessary adjustments to the object
World->AddPlayer(this);
- if (GetWorld()->GetDimension() != World->GetDimension())
- {
- GetClientHandle()->SendPlayerMoveLook();
- GetClientHandle()->SendHealth();
- GetClientHandle()->SendWholeInventory(*GetWindow());
- }
-
return true;
}