mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
fix(Core/Loot): Quest items should not be lootable/visible if quest objective already fulfilled (#7700)
- Closes #6442
This commit is contained in:
@@ -2151,7 +2151,7 @@ void Player::ReputationChanged2(FactionEntry const* factionEntry)
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::HasQuestForItem(uint32 itemid, uint32 excludeQuestId /* 0 */, bool turnIn /* false */) const
|
||||
bool Player::HasQuestForItem(uint32 itemid, uint32 excludeQuestId /* 0 */, bool turnIn /* false */, bool* showInLoot /*= nullptr*/) const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
|
||||
{
|
||||
@@ -2180,8 +2180,27 @@ bool Player::HasQuestForItem(uint32 itemid, uint32 excludeQuestId /* 0 */, bool
|
||||
// This part for ReqItem drop
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
if ((itemid == qinfo->RequiredItemId[j] && q_status.ItemCount[j] < qinfo->RequiredItemCount[j]) || (turnIn && q_status.ItemCount[j] >= qinfo->RequiredItemCount[j]))
|
||||
if (itemid == qinfo->RequiredItemId[j] && q_status.ItemCount[j] < qinfo->RequiredItemCount[j])
|
||||
{
|
||||
if (showInLoot)
|
||||
{
|
||||
if (GetItemCount(itemid, true) < qinfo->RequiredItemCount[j])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
*showInLoot = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (turnIn && q_status.ItemCount[j] >= qinfo->RequiredItemCount[j])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// This part - for ReqSource
|
||||
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j)
|
||||
|
||||
Reference in New Issue
Block a user