Chunk: Fixed same-name iterators.
This commit is contained in:
parent
4545b8eed9
commit
1480cdb944
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user