Core/SpawnTracking: Check if the objective is completable to get correct spawn tracking state (#30923)

(cherry picked from commit 553ce72707)

# Conflicts:
#	src/server/game/Entities/Player/Player.cpp
This commit is contained in:
Meji
2025-05-17 13:31:03 +02:00
committed by Ovahlord
parent bc930a9ca3
commit 550f66658d
2 changed files with 18 additions and 0 deletions

View File

@@ -16232,6 +16232,23 @@ bool Player::IsQuestObjectiveCompletable(uint16 slot, Quest const* quest, QuestO
return true;
}
bool Player::IsQuestObjectiveCompletable(uint32 questId, uint32 objectiveId) const
{
Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
if (!quest)
return false;
uint16 slot = FindQuestSlot(questId);
if (slot >= MAX_QUEST_LOG_SIZE)
return false;
QuestObjective const* obj = sObjectMgr->GetQuestObjective(objectiveId);
if (!obj)
return false;
return IsQuestObjectiveCompletable(slot, quest, *obj);
}
bool Player::IsQuestObjectiveComplete(uint16 slot, Quest const* quest, QuestObjective const& objective) const
{
switch (objective.Type)

View File

@@ -1647,6 +1647,7 @@ class TC_GAME_API Player final : public Unit, public GridObject<Player>
int32 GetQuestObjectiveData(QuestObjective const& objective) const;
void SetQuestObjectiveData(QuestObjective const& objective, int32 data);
bool IsQuestObjectiveCompletable(uint16 slot, Quest const* quest, QuestObjective const& objective) const;
bool IsQuestObjectiveCompletable(uint32 questId, uint32 objectiveId) const;
bool IsQuestObjectiveComplete(uint16 slot, Quest const* quest, QuestObjective const& objective) const;
bool IsQuestObjectiveComplete(uint32 questId, uint32 objectiveId) const;
bool IsQuestObjectiveProgressBarComplete(uint16 slot, Quest const* quest) const;