[8859] fixed bug which allowed to loot items multiple times

thx to burned for reporting
This commit is contained in:
balrok 2009-11-22 16:34:45 +01:00
parent d924406bd8
commit d63ea646a0
2 changed files with 6 additions and 6 deletions

View file

@ -9006,16 +9006,16 @@ uint8 Player::_CanStoreItem_InBag( uint8 bag, ItemPosCountVec &dest, ItemPrototy
Item* pItem2 = GetItemByPos( bag, j );
// ignore move item (this slot will be empty at move)
if (pItem2==pSrcItem)
if (pItem2 == pSrcItem)
pItem2 = NULL;
// if merge skip empty, if !merge skip non-empty
if ((pItem2!=NULL)!=merge)
if ((pItem2 != NULL) != merge)
continue;
if (pItem2)
{
if (pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
if (!pItem2->m_lootGenerated && pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
{
uint32 need_space = pProto->GetMaxStackSize() - pItem2->GetCount();
if(need_space > count)
@ -9067,12 +9067,12 @@ uint8 Player::_CanStoreItem_InInventorySlots( uint8 slot_begin, uint8 slot_end,
pItem2 = NULL;
// if merge skip empty, if !merge skip non-empty
if ((pItem2!=NULL)!=merge)
if ((pItem2 != NULL) != merge)
continue;
if (pItem2)
{
if (pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
if (!pItem2->m_lootGenerated && pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
{
uint32 need_space = pProto->GetMaxStackSize() - pItem2->GetCount();
if (need_space > count)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8858"
#define REVISION_NR "8859"
#endif // __REVISION_NR_H__