aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <none@none>2010-09-15 10:35:51 +0200
committerShauren <none@none>2010-09-15 10:35:51 +0200
commit5a312bdc3e67f92ed83e512798cfaed981637b3d (patch)
treea2a224e6b9dcd68e47d6523341a67680287e6314 /src
parenta582ab9d9d5890b54e5fd2a10e07be75a33b184d (diff)
Core/Loot: Check conditions before distributing currency
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Loot/LootMgr.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index a0fc3156c07..cf76cd4036d 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -476,18 +476,19 @@ void Loot::FillNotNormalLootFor(Player* pl, bool withCurrency)
// Process currency items
uint32 max_slot = GetMaxSlotInLootFor(pl);
- uint32 itemId = 0;
+ LootItem const *item = NULL;
uint32 itemsSize = uint32(items.size());
for (uint32 i = 0; i < max_slot; ++i)
{
if (i < items.size())
- itemId = items[i].itemid;
+ item = &items[i];
else
- itemId = quest_items[i-itemsSize].itemid;
+ item = &quest_items[i-itemsSize];
- if (ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemId))
- if (proto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
- pl->StoreLootItem(i, this);
+ if (!item->is_looted && item->freeforall && item->AllowedForPlayer(pl))
+ if (ItemPrototype const* proto = ObjectMgr::GetItemPrototype(item->itemid))
+ if (proto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ pl->StoreLootItem(i, this);
}
}