diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-07-30 18:35:39 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-07-30 18:35:39 +0200 |
commit | 2c9b67f00be95bd816dbaa9db43838a67e187753 (patch) | |
tree | 32da7cfefc4a27343e811954171e7f384ce8d663 /src/server/scripts | |
parent | e203a3bad75432ef0b067b9a4c10844f6dad77df (diff) |
Core/Quests: Fixed QuestScript::OnQuestStatusChange incorrectly triggering with QUEST_STATUS_INCOMPLETE when removing items from quest objectives on rewarding quest
Closes #31181
Diffstat (limited to 'src/server/scripts')
-rw-r--r-- | src/server/scripts/Commands/cs_quest.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 26b29e6fe79..00fb5c4bce8 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -117,25 +117,20 @@ public: if (oldStatus != QUEST_STATUS_NONE) { + player->RemoveActiveQuest(quest->GetQuestId(), false); + // remove all quest entries for 'entry' from quest log - for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot) + if (oldStatus != QUEST_STATUS_REWARDED) { - uint32 logQuest = player->GetQuestSlotQuestId(slot); - if (logQuest == quest->GetQuestId()) - { - player->SetQuestSlot(slot, 0); + // we ignore unequippable quest items in this case, its' still be equipped + player->TakeQuestSourceItem(quest->GetQuestId(), false); - // we ignore unequippable quest items in this case, its' still be equipped - player->TakeQuestSourceItem(logQuest, false); - - if (quest->HasFlag(QUEST_FLAGS_FLAGS_PVP)) - { - player->pvpInfo.IsHostile = player->pvpInfo.IsInHostileArea || player->HasPvPForcingQuest(); - player->UpdatePvPState(); - } + if (quest->HasFlag(QUEST_FLAGS_FLAGS_PVP)) + { + player->pvpInfo.IsHostile = player->pvpInfo.IsInHostileArea || player->HasPvPForcingQuest(); + player->UpdatePvPState(); } } - player->RemoveActiveQuest(quest->GetQuestId(), false); player->RemoveRewardedQuest(quest->GetQuestId()); player->DespawnPersonalSummonsForQuest(quest->GetQuestId()); |