From 4a406751afd6b1371b1919bf6d0a6f892d53ae33 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 21 Mar 2010 02:53:51 +0100 Subject: Add some more function calls to remove refund referenced from player's m_refundableItems, preventing the triggering of an assert in _saveInventory. --HG-- branch : trunk --- src/game/Item.cpp | 1 + src/game/Player.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 024e7138c13..35db772e845 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -629,6 +629,7 @@ void Item::SetState(ItemUpdateState state, Player *forplayer) { // pretend the item never existed RemoveFromUpdateQueueOf(forplayer); + forplayer->SetNotRefundable(GetGUID()); delete this; return; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 8def5f05d35..9fbc4c170f5 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -11245,6 +11245,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo RemoveItemDurations(pItem); pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + pItem->SetNotRefundable(this); pItem->SetState(ITEM_REMOVED, this); } @@ -11361,6 +11362,7 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) RemoveItemDurations(pItem); pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + pItem->SetNotRefundable(this); pItem->SetState(ITEM_REMOVED, this); pItem2->SetState(ITEM_CHANGED, this); @@ -11579,8 +11581,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) RemoveEnchantmentDurations(pItem); RemoveItemDurations(pItem); - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE)) - pItem->SetNotRefundable(this); + pItem->SetNotRefundable(this); ItemRemovedQuestCheck( pItem->GetEntry(), pItem->GetCount() ); -- cgit v1.2.3