From 5a312bdc3e67f92ed83e512798cfaed981637b3d Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 15 Sep 2010 10:35:51 +0200 Subject: Core/Loot: Check conditions before distributing currency --HG-- branch : trunk --- src/server/game/Loot/LootMgr.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/server') 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); } } -- cgit v1.2.3