fix(Core/Loot): restore hide quest starter item conditions (#25355)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
sogladev 2026-04-05 16:17:21 +02:00 committed by GitHub
parent 33f8380fca
commit 42fe005764
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -441,8 +441,26 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const
return false;
// check quest requirements
if (needs_quest && !pProto->HasFlagCu(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && !player->HasQuestForItem(itemid))
return false;
if (!pProto->HasFlagCu(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS))
{
if (needs_quest && !player->HasQuestForItem(itemid))
return false;
// Hide quest starter items when quest is already started/rewarded,
// when unique count is already reached, or when prerequisite is missing.
if (pProto->StartQuest)
{
uint32 prevQuestId = 0;
if (Quest const* startQuest = sObjectMgr->GetQuestTemplate(pProto->StartQuest))
prevQuestId = startQuest->GetPrevQuestId();
if (player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE ||
player->GetQuestRewardStatus(pProto->StartQuest) ||
(pProto->MaxCount && player->HasItemCount(itemid, pProto->MaxCount, true)) ||
(prevQuestId && !player->GetQuestRewardStatus(prevQuestId)))
return false;
}
}
if (!sScriptMgr->OnAllowedForPlayerLootCheck(player, source))
return false;