Browse Source

Missing spawnlist lock on sending spawns to client!

Fixes #96, CreateGhost CRC error seen in alertlog.txt is now gone
Image 4 years ago
parent
commit
c96fb809e4
1 changed files with 4 additions and 2 deletions
  1. 4 2
      EQ2/source/WorldServer/zoneserver.cpp

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

@@ -1106,11 +1106,13 @@ void ZoneServer::CheckSendSpawnToClient(){
 	Client* client = 0;
 
 	MClientList.readlock(__FUNCTION__, __LINE__);
+	MSpawnList.readlock(__FUNCTION__, __LINE__);
 	for (itr = clients.begin(); itr != clients.end(); itr++) {
 		client = *itr;
 		if(client->IsReadyForSpawns())
 			CheckSendSpawnToClient(client);
 	}
+	MSpawnList.releasereadlock(__FUNCTION__, __LINE__);
 	MClientList.releasereadlock(__FUNCTION__, __LINE__);
 }
 
@@ -4664,9 +4666,9 @@ void ZoneServer::SendZoneSpawns(Client* client){
 			CheckSpawnRange(client, spawn, true);
 		}
 	}
-	MSpawnList.releasereadlock(__FUNCTION__, __LINE__);
-	
+
 	CheckSendSpawnToClient(client, true);
+	MSpawnList.releasereadlock(__FUNCTION__, __LINE__);
 	client->SetConnected(true);
 	ClientPacketFunctions::SendFinishedEntitiesList(client);
 	initial_spawn_threads_active--;