aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSnapperRy <snapperryen@gmail.com>2016-10-03 23:33:44 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-03-05 01:06:44 +0100
commit8c7b3c8a2bd4cc8ab07213c07d0e9527ed77b4f2 (patch)
tree0d3cb959541969cd3f50bc4b14046f17073ed5df /src
parentde8aecacbc01afe864bc5471665834a1f8444011 (diff)
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)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Loot/LootMgr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 7b4b5a4d912..3607d1fb7bd 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -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;
}