summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-06-06 18:20:21 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-06-28 22:54:21 +0200
commit93611b84377e6453d1444a91b4d9ffda08cdf7f2 (patch)
treece5081e46cdacb7816c7ca5bd059980ed4db4fe7 /src/Entities/Player.cpp
parentWindows: do not include sdkddkver before defining WIN32_WINNT (diff)
downloadcuberite-93611b84377e6453d1444a91b4d9ffda08cdf7f2.tar
cuberite-93611b84377e6453d1444a91b4d9ffda08cdf7f2.tar.gz
cuberite-93611b84377e6453d1444a91b4d9ffda08cdf7f2.tar.bz2
cuberite-93611b84377e6453d1444a91b4d9ffda08cdf7f2.tar.lz
cuberite-93611b84377e6453d1444a91b4d9ffda08cdf7f2.tar.xz
cuberite-93611b84377e6453d1444a91b4d9ffda08cdf7f2.tar.zst
cuberite-93611b84377e6453d1444a91b4d9ffda08cdf7f2.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index fcdbcf64c..12d937baf 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -776,9 +776,9 @@ void cPlayer::SetCustomName(const AString & a_CustomName)
-void cPlayer::SetBedPos(const Vector3i & a_Pos)
+void cPlayer::SetBedPos(const Vector3i a_Position)
{
- m_LastBedPos = a_Pos;
+ m_LastBedPos = a_Position;
m_SpawnWorldName = m_World->GetName();
}
@@ -786,11 +786,10 @@ void cPlayer::SetBedPos(const Vector3i & a_Pos)
-void cPlayer::SetBedPos(const Vector3i & a_Pos, cWorld * a_World)
+void cPlayer::SetBedPos(const Vector3i a_Position, const cWorld & a_World)
{
- m_LastBedPos = a_Pos;
- ASSERT(a_World != nullptr);
- m_SpawnWorldName = a_World->GetName();
+ m_LastBedPos = a_Position;
+ m_SpawnWorldName = a_World.GetName();
}
@@ -1752,7 +1751,7 @@ void cPlayer::LoadFromDisk()
const Vector3i WorldSpawn(static_cast<int>(m_World->GetSpawnX()), static_cast<int>(m_World->GetSpawnY()), static_cast<int>(m_World->GetSpawnZ()));
SetPosition(WorldSpawn);
- SetBedPos(WorldSpawn, m_World);
+ SetBedPos(WorldSpawn, *m_World);
m_Inventory.Clear();
m_EnchantmentSeed = GetRandomProvider().RandInt<unsigned int>(); // Use a random number to seed the enchantment generator