diff options
author | megamage <none@none> | 2009-01-12 10:53:53 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-12 10:53:53 -0600 |
commit | 4daadd712f46e85ee8754428dfc92e9ac91c9c47 (patch) | |
tree | d8f81f4a10f3bc4087b05a02d2e5b93f42d601bb /src/game/LootHandler.cpp | |
parent | 218f4c4c4b6cf3a91ad696d08d09085f480ccea8 (diff) |
*Update to Mangos 7072.
*Remove some duplicated functions of possess.
--HG--
branch : trunk
Diffstat (limited to 'src/game/LootHandler.cpp')
-rw-r--r-- | src/game/LootHandler.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp index f1110ca3853..8f8b5d2b6e9 100644 --- a/src/game/LootHandler.cpp +++ b/src/game/LootHandler.cpp @@ -384,14 +384,22 @@ void WorldSession::DoLootRelease( uint64 lguid ) Item *pItem = player->GetItemByGuid(lguid ); if(!pItem) return; - if( (pItem->GetProto()->BagFamily & BAG_FAMILY_MASK_MINING_SUPP) && - pItem->GetProto()->Class == ITEM_CLASS_TRADE_GOODS && - pItem->GetCount() >= 5) + + ItemPrototype const* proto = pItem->GetProto(); + + // destroy only 5 items from stack in case prospecting and milling + if( (proto->BagFamily & (BAG_FAMILY_MASK_MINING_SUPP|BAG_FAMILY_MASK_HERBS)) && + proto->Class == ITEM_CLASS_TRADE_GOODS) { pItem->m_lootGenerated = false; pItem->loot.clear(); - uint32 count = 5; + uint32 count = pItem->GetCount(); + + // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks. + if(count > 5) + count = 5; + player->DestroyItemCount(pItem, count, true); } else |