Explorar o código

chest trap write lock when shuffling the map

Image %!s(int64=4) %!d(string=hai) anos
pai
achega
1db0dba76c
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      EQ2/source/WorldServer/Zone/ChestTrap.cpp

+ 3 - 0
EQ2/source/WorldServer/Zone/ChestTrap.cpp

@@ -66,7 +66,10 @@ bool ChestTrapList::GetNextChestTrap(ChestTrap::ChestTrapInfo* cti) {
 	{
 	{
 		MChestTrapList.releasereadlock(__FUNCTION__, __LINE__);
 		MChestTrapList.releasereadlock(__FUNCTION__, __LINE__);
 		//re-shuffle the map, we reached the end
 		//re-shuffle the map, we reached the end
+
+		MChestTrapList.writelock(__FUNCTION__, __LINE__);
 		shuffleMap(this);
 		shuffleMap(this);
+		MChestTrapList.releasewritelock(__FUNCTION__, __LINE__);
 	}
 	}
 	else
 	else
 		MChestTrapList.releasereadlock(__FUNCTION__, __LINE__);
 		MChestTrapList.releasereadlock(__FUNCTION__, __LINE__);