summaryrefslogtreecommitdiffstats
path: root/src/Map.cpp
diff options
context:
space:
mode:
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);
}