From a1dc4d326307cde84bdcc1d069e18ea417262c0d Mon Sep 17 00:00:00 2001 From: balrok Date: Sun, 22 Nov 2009 23:53:56 +0100 Subject: [PATCH] [8862] Revert "[8859] fixed bug which allowed to loot items multiple times" This reverts commit 47c743890e671d8f29a8a71e7a08e5d523f1c070. bug wasn't fixed through this commit.. also those checks were wrong in future it should work totaly different: when lootwindow is opened the items must already be destroyed moving items on the stack should be allowed thx to seizerkiller for testing.. in this commit i just check if the item which should get moved is getting looted in Item::swap and guildbank this is already checked.. only the check at moving to own bank was missing --- src/game/Player.cpp | 7 +++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index af7a82edd..038cc3846 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -9015,7 +9015,7 @@ uint8 Player::_CanStoreItem_InBag( uint8 bag, ItemPosCountVec &dest, ItemPrototy if (pItem2) { - if (!pItem2->m_lootGenerated && pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize()) + if (pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize()) { uint32 need_space = pProto->GetMaxStackSize() - pItem2->GetCount(); if(need_space > count) @@ -9072,7 +9072,7 @@ uint8 Player::_CanStoreItem_InInventorySlots( uint8 slot_begin, uint8 slot_end, if (pItem2) { - if (!pItem2->m_lootGenerated && pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize()) + if (pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize()) { uint32 need_space = pProto->GetMaxStackSize() - pItem2->GetCount(); if (need_space > count) @@ -9972,6 +9972,9 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p if (!pItem) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; + if (pItem->m_lootGenerated) + return EQUIP_ERR_ITEM_LOCKED; + uint32 count = pItem->GetCount(); sLog.outDebug( "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3269bfecc..fe3c18f99 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8861" + #define REVISION_NR "8862" #endif // __REVISION_NR_H__