summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-03-31 19:17:35 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-03-31 19:17:35 +0200
commit02adc020452d3e87d78da9d812cd8d5473f212e5 (patch)
tree1e6e4ff45405f57c7a20660876430f3a7fddc402 /src/Entities/Player.cpp
parentMerge pull request #3105 from LogicParrot/chunkStability (diff)
parentPlayer death crashfix (diff)
downloadcuberite-02adc020452d3e87d78da9d812cd8d5473f212e5.tar
cuberite-02adc020452d3e87d78da9d812cd8d5473f212e5.tar.gz
cuberite-02adc020452d3e87d78da9d812cd8d5473f212e5.tar.bz2
cuberite-02adc020452d3e87d78da9d812cd8d5473f212e5.tar.lz
cuberite-02adc020452d3e87d78da9d812cd8d5473f212e5.tar.xz
cuberite-02adc020452d3e87d78da9d812cd8d5473f212e5.tar.zst
cuberite-02adc020452d3e87d78da9d812cd8d5473f212e5.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 c94cec3c9..804a92284 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -108,7 +108,9 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) :
SetPosX(World->GetSpawnX());
SetPosY(World->GetSpawnY());
SetPosZ(World->GetSpawnZ());
- SetBedPos(Vector3i(static_cast<int>(World->GetSpawnX()), static_cast<int>(World->GetSpawnY()), static_cast<int>(World->GetSpawnZ())));
+
+ // This is a new player. Set the player spawn point to the spawn point of the default world
+ SetBedPos(Vector3i(static_cast<int>(World->GetSpawnX()), static_cast<int>(World->GetSpawnY()), static_cast<int>(World->GetSpawnZ())), World);
LOGD("Player \"%s\" is connecting for the first time, spawning at default world spawn {%.2f, %.2f, %.2f}",
a_PlayerName.c_str(), GetPosX(), GetPosY(), GetPosZ()
@@ -1990,7 +1992,7 @@ bool cPlayer::SaveToDisk()
root["SpawnX"] = GetLastBedPos().x;
root["SpawnY"] = GetLastBedPos().y;
root["SpawnZ"] = GetLastBedPos().z;
- root["SpawnWorld"] = m_SpawnWorld->GetName();
+ root["SpawnWorld"] = m_SpawnWorld->GetName();
if (m_World != nullptr)
{