Browse Source

Fixed deadlock caused by GetSpellSlot in against mutex MSpellsBook

Image 3 years ago
parent
commit
fb9ec032f8
1 changed files with 5 additions and 1 deletions
  1. 5 1
      EQ2/source/WorldServer/Player.cpp

+ 5 - 1
EQ2/source/WorldServer/Player.cpp

@@ -2475,7 +2475,11 @@ int8 Player::GetSpellSlot(int32 spell_id){
 	for(itr = spells.begin(); itr != spells.end(); itr++){
 		spell = *itr;
 		if(spell->spell_id == spell_id)
-			return spell->slot;
+		{
+			int8 slot = spell->slot;
+			MSpellsBook.unlock();
+			return slot;
+		}
 	}
 	MSpellsBook.unlock();
 	return 0;