mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[7065] Fix herbs consum at milling.
Use 5 items from stack instead all stack.
This commit is contained in:
parent
7162d82a4d
commit
439db0eae3
2 changed files with 13 additions and 5 deletions
|
|
@ -372,14 +372,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue