Browse Source

Fix quests dialog crashing in AoM

Fix #212
Image 4 years ago
parent
commit
9bcd1eeb47
2 changed files with 6 additions and 4 deletions
  1. 2 1
      EQ2/source/WorldServer/Quests.cpp
  2. 4 3
      EQ2/source/WorldServer/client.cpp

+ 2 - 1
EQ2/source/WorldServer/Quests.cpp

@@ -1010,7 +1010,8 @@ EQ2Packet* Quest::QuestJournalReply(int16 version, int32 player_crc, Player* pla
 				packet->setDataByName("unknown3", 1, 6);
 			}
 		}
-		else if ((version >= 1096 || version == 546) && GetCompleted() && HasSentLastUpdate()) { //need to send last quest update before erasing all progress of the quest
+		// must always send for newer clients like AoM or else crash!
+		else if (GetCompleted() && ((version >= 1096) || (version == 546 && HasSentLastUpdate()))) { //need to send last quest update before erasing all progress of the quest
 			packet->setDataByName("complete", 1);
 			packet->setDataByName("complete2", 1);
 			packet->setDataByName("complete3", 1);

+ 4 - 3
EQ2/source/WorldServer/client.cpp

@@ -5379,9 +5379,10 @@ void Client::SendQuestUpdate(Quest* quest) {
 			step = updates->at(i);
 			if (lua_interface && step->Complete() && quest->GetCompleteAction(step->GetStepID()))
 				lua_interface->CallQuestFunction(quest, quest->GetCompleteAction(step->GetStepID()), player);
-			if (step->WasUpdated()) {				
-				QueuePacket(quest->QuestJournalReply(GetVersion(), GetNameCRC(), player, step));
+			if (step->WasUpdated()) {
+				// reversing the order of SendQuestJournal and QueuePacket QuestJournalReply causes AoM client to crash!
 				SendQuestJournal(false, 0, true);
+				QueuePacket(quest->QuestJournalReply(GetVersion(), GetNameCRC(), player, step));
 			}
 			LogWrite(CCLIENT__DEBUG, 0, "Client", "Send Quest Journal...");
 
@@ -9811,4 +9812,4 @@ void Client::TempRemoveGroup()
 
 		world.GetGroupManager()->ReleaseGroupLock(__FUNCTION__, __LINE__);
 	}
-}
+}