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

(cherry picked from commit 5c5b8df6138a94f5bc74d7eda0f894d825b5f63c)

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

(cherry picked from commit ea6911517d38aa8ea493dbe88a33c9734d86bb04)
This commit is contained in:
SnapperRy
2017-03-05 01:06:44 +01:00
committed by joschiwald
parent de8aecacbc
commit 8c7b3c8a2b
+4
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;
}