feat: read quest completion state from update fields on login and mid-session

resyncQuestLogFromServerSlots now reads the state field (slot*stride+1)
alongside the quest ID field, and marks quest.complete=true when the
server reports QuestStatus=1 (complete/ready-to-turn-in). Previously,
quests that were already complete before login would remain incorrectly
marked as incomplete until SMSG_QUESTUPDATE_COMPLETE fired, which only
happens when objectives are NEWLY completed during the session.

applyQuestStateFromFields() is a lightweight companion called from both
the CREATE and VALUES update handlers that applies the same state-field
check to already-tracked quests mid-session, catching the case where
the last objective completes via an update-field delta rather than the
dedicated quest-complete packet.

Works across all expansion strides (Classic stride=3, TBC stride=4,
WotLK stride=5); guarded against stride<2 (no state field available).
This commit is contained in:
Kelsi 2026-03-10 23:33:38 -07:00
parent 3a7ff71262
commit 7e55d21cdd
2 changed files with 81 additions and 5 deletions

View file

@ -2362,6 +2362,7 @@ private:
void loadSkillLineAbilityDbc();
void extractSkillFields(const std::map<uint16_t, uint32_t>& fields);
void extractExploredZoneFields(const std::map<uint16_t, uint32_t>& fields);
void applyQuestStateFromFields(const std::map<uint16_t, uint32_t>& fields);
NpcDeathCallback npcDeathCallback_;
NpcAggroCallback npcAggroCallback_;