瀏覽代碼

chest trap write lock when shuffling the map

Image 4 年之前
父節點
當前提交
1db0dba76c
共有 1 個文件被更改,包括 3 次插入0 次删除
  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__);
 		//re-shuffle the map, we reached the end
+
+		MChestTrapList.writelock(__FUNCTION__, __LINE__);
 		shuffleMap(this);
+		MChestTrapList.releasewritelock(__FUNCTION__, __LINE__);
 	}
 	else
 		MChestTrapList.releasereadlock(__FUNCTION__, __LINE__);