Core/Players: Call OnQuestObjectiveChange after updating objective counters

Fix SMART_EVENT_QUEST_OBJ_COMPLETION trigger

(cherry picked from commit 7445d528d2)

# Conflicts:
#	src/server/game/Entities/Player/Player.cpp
This commit is contained in:
Meji
2025-04-13 20:31:30 +02:00
committed by Ovahlord
parent 5fda07a28b
commit 86a7f9e2ff

View File

@@ -16166,9 +16166,6 @@ void Player::SetQuestObjectiveData(QuestObjective const& objective, int32 data)
if (oldData == data)
return;
if (Quest const* quest = sObjectMgr->GetQuestTemplate(objective.QuestID))
sScriptMgr->OnQuestObjectiveChange(this, quest, objective, oldData, data);
// Add to save
m_QuestStatusSave[objective.QuestID] = QUEST_DEFAULT_SAVE_TYPE;
@@ -16179,6 +16176,9 @@ void Player::SetQuestObjectiveData(QuestObjective const& objective, int32 data)
SetQuestSlotState(status.Slot, 256 << objective.StorageIndex);
else
RemoveQuestSlotState(status.Slot, 256 << objective.StorageIndex);
if (Quest const* quest = sObjectMgr->GetQuestTemplate(objective.QuestID))
sScriptMgr->OnQuestObjectiveChange(this, quest, objective, oldData, data);
}
bool Player::IsQuestObjectiveCompletable(uint16 slot, Quest const* quest, QuestObjective const& objective) const