Browse Source

Spawn Updates (bulk packets) also need to lock the spawn list

Image 4 years ago
parent
commit
ac74760636
1 changed files with 4 additions and 0 deletions
  1. 4 0
      EQ2/source/WorldServer/zoneserver.cpp

+ 4 - 0
EQ2/source/WorldServer/zoneserver.cpp

@@ -1842,6 +1842,9 @@ void ZoneServer::ProcessDrowning(){
 void ZoneServer::SendSpawnChanges(){
 	set<Spawn*> spawns_to_send;
 	Spawn* spawn = 0;
+
+	MSpawnList.readlock(__FUNCTION__, __LINE__);
+
 	MutexList<int32>::iterator spawn_iter = changed_spawns.begin();
 	int count = 0;
 	while(spawn_iter.Next()){		
@@ -1869,6 +1872,7 @@ void ZoneServer::SendSpawnChanges(){
 		spawn->vis_changed = false;
 		spawn->info_changed = false;
 	}
+	MSpawnList.releasereadlock(__FUNCTION__, __LINE__);
 }
 
 void ZoneServer::SendPlayerPositionChanges(Player* player){