summaryrefslogtreecommitdiffstats
path: root/src/Map.cpp
diff options
context:
space:
mode:
authorandrew <xdotftw@gmail.com>2014-02-23 14:03:40 +0100
committerandrew <xdotftw@gmail.com>2014-02-23 14:05:03 +0100
commitf47187394572027cbfa07884cba2f54eaa6972ec (patch)
tree1f87d8d3f350b1d0c3faf5963c2ad74482ac3174 /src/Map.cpp
parentManually exported DoWithMap (diff)
downloadcuberite-f47187394572027cbfa07884cba2f54eaa6972ec.tar
cuberite-f47187394572027cbfa07884cba2f54eaa6972ec.tar.gz
cuberite-f47187394572027cbfa07884cba2f54eaa6972ec.tar.bz2
cuberite-f47187394572027cbfa07884cba2f54eaa6972ec.tar.lz
cuberite-f47187394572027cbfa07884cba2f54eaa6972ec.tar.xz
cuberite-f47187394572027cbfa07884cba2f54eaa6972ec.tar.zst
cuberite-f47187394572027cbfa07884cba2f54eaa6972ec.zip
Diffstat (limited to '')
-rw-r--r--src/Map.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Map.cpp b/src/Map.cpp
index e89fad8b0..2b8c4c74c 100644
--- a/src/Map.cpp
+++ b/src/Map.cpp
@@ -344,13 +344,19 @@ void cMap::UpdateDecorators(void)
-void cMap::AddPlayer(cPlayer * a_Player, cClientHandle * a_Handle, Int64 a_WorldAge)
+void cMap::AddPlayer(cPlayer * a_Player, Int64 a_WorldAge)
{
+ cClientHandle * Handle = a_Player->GetClientHandle();
+ if (Handle == NULL)
+ {
+ return;
+ }
+
cMapClient MapClient;
MapClient.m_LastUpdate = a_WorldAge;
MapClient.m_SendInfo = true;
- MapClient.m_Handle = a_Handle;
+ MapClient.m_Handle = Handle;
m_Clients.push_back(MapClient);
@@ -470,7 +476,7 @@ void cMap::UpdateClient(cPlayer * a_Player)
}
// New player, construct a new client state
- AddPlayer(a_Player, Handle, WorldAge);
+ AddPlayer(a_Player, WorldAge);
}