From a0d8b0be48ea0419d6014d0a54256f4ef278c860 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 20 Mar 2010 16:26:16 +0100 Subject: Item system update - Set ITEM_FIELD_CREATE_PLAYED_TIME to 0 in Item::Create, should fix crash described in issue 1199 - Change some function calls so on Player::_saveInventory the core doesn't have to check for existance of item anymore when iterating over m_refundableItems. The loop will now only update played time, removal of items from this set is done in other functions. - Cleanup in affected functions. --HG-- branch : trunk --- src/game/TradeHandler.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/game/TradeHandler.cpp') diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp index 7baf068708a..d64b2f04d2f 100644 --- a/src/game/TradeHandler.cpp +++ b/src/game/TradeHandler.cpp @@ -202,9 +202,6 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) _player->pTrader->GetName(),_player->pTrader->GetSession()->GetAccountId()); } - - // make not refundable - myItems[i]->SetNotRefundable(_player); // store _player->pTrader->MoveItemToInventory( traderDst, myItems[i], true, true); } @@ -220,8 +217,6 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) _player->GetName(),_player->GetSession()->GetAccountId()); } - // make not refundable - hisItems[i]->SetNotRefundable(_player->pTrader); // store _player->MoveItemToInventory( playerDst, hisItems[i], true, true); } @@ -378,12 +373,14 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) myItems[i]->SetUInt64Value( ITEM_FIELD_GIFTCREATOR, _player->GetGUID()); iPtr = _player->GetItemByGuid(_player->tradeItems[i]); _player->MoveItemFromInventory(iPtr->GetBagSlot(), iPtr->GetSlot(), true); + myItems[i]->SetNotRefundable(_player); } if (hisItems[i]) { hisItems[i]->SetUInt64Value( ITEM_FIELD_GIFTCREATOR,_player->pTrader->GetGUID()); iPtr = _player->pTrader->GetItemByGuid(_player->pTrader->tradeItems[i]); _player->pTrader->MoveItemFromInventory(iPtr->GetBagSlot(), iPtr->GetSlot(), true); + hisItems[i]->SetNotRefundable(_player->pTrader); } } -- cgit v1.2.3