[7065] Fix herbs consum at milling.

Use 5 items from stack instead all stack.
This commit is contained in:
VladimirMangos 2009-01-10 20:57:46 +03:00
parent 7162d82a4d
commit 439db0eae3
2 changed files with 13 additions and 5 deletions

View file

@ -372,14 +372,22 @@ void WorldSession::DoLootRelease( uint64 lguid )
Item *pItem = player->GetItemByGuid(lguid ); Item *pItem = player->GetItemByGuid(lguid );
if(!pItem) if(!pItem)
return; return;
if( (pItem->GetProto()->BagFamily & BAG_FAMILY_MASK_MINING_SUPP) &&
pItem->GetProto()->Class == ITEM_CLASS_TRADE_GOODS && ItemPrototype const* proto = pItem->GetProto();
pItem->GetCount() >= 5)
// 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->m_lootGenerated = false;
pItem->loot.clear(); 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); player->DestroyItemCount(pItem, count, true);
} }
else else

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7064" #define REVISION_NR "7065"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__