1
0

Chunk: Fixed same-name iterators.

This commit is contained in:
Mattes D 2014-11-27 23:15:08 +01:00
parent 4545b8eed9
commit 1480cdb944

View File

@ -1869,18 +1869,18 @@ bool cChunk::AddClient(cClientHandle * a_Client)
void cChunk::RemoveClient(cClientHandle * a_Client) void cChunk::RemoveClient(cClientHandle * a_Client)
{ {
for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr) for (cClientHandleList::iterator itrC = m_LoadedByClient.begin(); itrC != m_LoadedByClient.end(); ++itrC)
{ {
if (*itr != a_Client) if (*itrC != a_Client)
{ {
continue; continue;
} }
m_LoadedByClient.erase(itr); m_LoadedByClient.erase(itrC);
if (!a_Client->IsDestroyed()) if (!a_Client->IsDestroyed())
{ {
for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr) for (cEntityList::iterator itrE = m_Entities.begin(); itrE != m_Entities.end(); ++itrE)
{ {
/* /*
// DEBUG: // DEBUG:
@ -1889,7 +1889,7 @@ void cChunk::RemoveClient(cClientHandle * a_Client)
(*itr)->GetUniqueID(), a_Client->GetUsername().c_str() (*itr)->GetUniqueID(), a_Client->GetUsername().c_str()
); );
*/ */
a_Client->SendDestroyEntity(*(*itr)); a_Client->SendDestroyEntity(*(*itrE));
} }
} }
return; return;