Browse Source

try to address a locking issue with MPlayerQuests

Emagi 1 year ago
parent
commit
1fec040744
1 changed files with 6 additions and 3 deletions
  1. 6 3
      EQ2/source/WorldServer/Player.cpp

+ 6 - 3
EQ2/source/WorldServer/Player.cpp

@@ -5122,6 +5122,7 @@ bool Player::SendQuestStepUpdate(int32 quest_id, int32 quest_step_id, bool displ
 		MPlayerQuests.releasereadlock(__FUNCTION__, __LINE__);
 		return false;
 	}
+	
 	QuestStep* quest_step = quest->GetQuestStep(quest_step_id);
 	if (quest_step) {
 		if(GetClient()) {
@@ -5129,10 +5130,12 @@ bool Player::SendQuestStepUpdate(int32 quest_id, int32 quest_step_id, bool displ
 		}
 		quest_step->WasUpdated(false);
 	}
-	if(quest->GetTurnedIn() && GetClient()) //update the journal so the old quest isn't the one displayed in the client's quest helper
-		GetClient()->SendQuestJournal();
-		
+	bool turnedIn = quest->GetTurnedIn();
+	
 	MPlayerQuests.releasereadlock(__FUNCTION__, __LINE__);
+	
+	if(turnedIn && GetClient()) //update the journal so the old quest isn't the one displayed in the client's quest helper
+		GetClient()->SendQuestJournal();
 }
 
 void Player::SendQuest(int32 quest_id) {