aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSnapperRy <snapperryen@gmail.com>2016-10-03 23:33:44 +0200
committerSnapperRy <snapperryen@gmail.com>2016-10-03 23:33:44 +0200
commit5c5b8df6138a94f5bc74d7eda0f894d825b5f63c (patch)
tree15f6bf09ef13de50b6319c0d3769537a2aa29036 /src
parent9bca68fb56a48870548d9f27857d3d879eb77adb (diff)
Core/Loot: do not show unique items if player already has the maximum allowed quantity.
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 260e7ff464f..991d6b92ac2 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -394,6 +394,10 @@ bool LootItem::AllowedForPlayer(Player const* player) const
if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid)))
return false;
+ // Don't show unique items if player already has the maximum allowed quantity.
+ if (pProto->MaxCount && int32(player->GetItemCount(itemid, true)) >= pProto->MaxCount)
+ return false;
+
return true;
}