Crash on spawn condition trigger
Fixes #20 when we are removing a spawn at the same time iterating the spawn_list to trigger spawn conditions
This commit is contained in:
parent
63c7e29e83
commit
b9eb09dacd
1 changed files with 3 additions and 3 deletions
|
@ -3733,9 +3733,9 @@ void ZoneServer::RemoveSpawn(Spawn* spawn, bool delete_spawn, bool respawn, bool
|
|||
Client* client = 0;
|
||||
|
||||
// Clear the pointer in the spawn list, spawn thread will remove the key
|
||||
MSpawnList.readlock(__FUNCTION__, __LINE__);
|
||||
spawn_list[spawn->GetID()] = 0;
|
||||
MSpawnList.releasereadlock(__FUNCTION__, __LINE__);
|
||||
MSpawnList.writelock(__FUNCTION__, __LINE__);
|
||||
spawn_list.erase(spawn->GetID());
|
||||
MSpawnList.releasewritelock(__FUNCTION__, __LINE__);
|
||||
|
||||
vector<Client*>::iterator client_itr;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue