summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-22 18:26:48 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-22 18:26:48 +0200
commita28b0dc1201dca7c34d9a6c33232157e45a6d4f8 (patch)
treec904fd2faa10ed724e7229749b31ad6fe37fed9b /src/Entities/Player.cpp
parentSuggestion and failed merge fix (diff)
downloadcuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.gz
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.bz2
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.lz
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.xz
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.zst
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index e54e10a08..087ac448f 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -95,7 +95,7 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) :
SetPosX(World->GetSpawnX());
SetPosY(World->GetSpawnY());
SetPosZ(World->GetSpawnZ());
- SetBedPos(Vector3i(World->GetSpawnX(), World->GetSpawnY(), World->GetSpawnZ()));
+ SetBedPos(Vector3i((int)World->GetSpawnX(), (int)World->GetSpawnY(), (int)World->GetSpawnZ()));
LOGD("Player \"%s\" is connecting for the first time, spawning at default world spawn {%.2f, %.2f, %.2f}",
a_PlayerName.c_str(), GetPosX(), GetPosY(), GetPosZ()
@@ -1611,6 +1611,8 @@ void cPlayer::TossItems(const cItems & a_Items)
bool cPlayer::MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
{
+ ASSERT(a_World != NULL);
+
if (GetWorld() == a_World)
{
// Don't move to same world
@@ -1624,7 +1626,7 @@ bool cPlayer::MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
}
// Remove player from the old world
- SetWorldTravellingFrom(GetWorld()); // cChunk handles entity removal
+ SetWorldTravellingFrom(GetWorld()); // cChunk handles entity removal
GetWorld()->RemovePlayer(this);
// Queue adding player to the new world, including all the necessary adjustments to the object