Core/Loot: do not show unique items if player already has the maximum allowed quantity.

(cherry picked from commit 5c5b8df613)

Core/Loot: limit unique items check in LootItem::AllowedForPlayer() to bind-when-picked-up items only.

(cherry picked from commit ea6911517d)
This commit is contained in:
SnapperRy
2016-10-03 23:33:44 +02:00
committed by joschiwald
parent de8aecacbc
commit 8c7b3c8a2b

View File

@@ -401,6 +401,10 @@ bool LootItem::AllowedForPlayer(Player const* player) const
if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->GetStartQuest() && player->GetQuestStatus(pProto->GetStartQuest()) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid)))
return false;
// Don't show bind-when-picked-up unique items if player already has the maximum allowed quantity.
if (pProto->GetBonding() == BIND_ON_ACQUIRE && pProto->GetMaxCount() && int32(player->GetItemCount(itemid, true)) >= pProto->GetMaxCount())
return false;
return true;
}