aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Loot/LootMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Loot/LootMgr.cpp')
-rw-r--r--src/server/game/Loot/LootMgr.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 77b7f08fd5a..d331f7e7ca1 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -346,10 +346,21 @@ LootItem::LootItem(LootStoreItem const& li)
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
bool LootItem::AllowedForPlayer(Player const * player) const
{
- // DB conditions check
+ // DB conditions check
if (!sConditionMgr.IsPlayerMeetToConditions(const_cast<Player*>(player), conditions))
return false;
+ ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid);
+ if (!pProto)
+ return false;
+
+ // not show loot for not own team
+ if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && player->GetTeam() != HORDE)
+ return false;
+
+ if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && player->GetTeam() != ALLIANCE)
+ return false;
+
if (needs_quest)
{
// Checking quests for quest-only drop (check only quests requirements in this case)
@@ -359,9 +370,8 @@ bool LootItem::AllowedForPlayer(Player const * player) const
else
{
// Not quest only drop (check quest starting items for already accepted non-repeatable quests)
- if (ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid))
- if (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid))
- return false;
+ if (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid))
+ return false;
}
return true;