summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/cClientHandle.cpp6
-rw-r--r--source/cWorld.cpp3
2 files changed, 9 insertions, 0 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index f31daf79e..fbbe6b89d 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -261,7 +261,13 @@ void cClientHandle::Kick(const AString & a_Reason)
void cClientHandle::Authenticate(void)
{
+ if (m_State != csAuthenticating)
+ {
+ return;
+ }
+
ASSERT( m_Player == NULL );
+
// Spawn player (only serversided, so data is loaded)
m_Player = new cPlayer(this, GetUsername());
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index 85faa72e0..3c63f2b28 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -1057,6 +1057,9 @@ void cWorld::SetMaxPlayers(int iMax)
void cWorld::AddPlayer( cPlayer* a_Player )
{
cCSLock Lock(m_CSPlayers);
+
+ ASSERT(std::find(m_Players.begin(), m_Players.end(), a_Player) == m_Players.end()); // Is it already in the list? HOW?
+
m_Players.remove( a_Player ); // Make sure the player is registered only once
m_Players.push_back( a_Player );
}