Fix crash in Player::_saveInventory().
Fixes issue #1175 --HG-- branch : trunk
This commit is contained in:
+1
-1
@@ -247,6 +247,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
GetPlayerName(), GetAccountId(), item->GetProto()->Name1, item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
|
||||
}
|
||||
|
||||
item->SetNotRefundable(GetPlayer()); // makes the item no longer refundable
|
||||
pl->MoveItemFromInventory(items[i]->GetBagSlot(), item->GetSlot(), true);
|
||||
CharacterDatabase.BeginTransaction();
|
||||
item->DeleteFromInventoryDB(); // deletes item from character's inventory
|
||||
@@ -254,7 +255,6 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
// owner in data will set at mail receive and item extracting
|
||||
CharacterDatabase.PExecute("UPDATE item_instance SET owner_guid = '%u' WHERE guid='%u'", GUID_LOPART(rc), item->GetGUIDLow());
|
||||
CharacterDatabase.CommitTransaction();
|
||||
|
||||
draft.AddItem(item);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -17494,7 +17494,7 @@ void Player::_SaveInventory()
|
||||
// Item could be deleted, or traded.
|
||||
// In the first case, DeleteRefundDataFromDB() was already called in Item::SaveToDB()
|
||||
Item* iPtr = (*itr);
|
||||
if (!iPtr || iPtr->GetOwner() != this)
|
||||
if (!iPtr)
|
||||
m_refundableItems.erase(itr++);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -202,6 +202,9 @@ 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);
|
||||
}
|
||||
@@ -217,6 +220,8 @@ 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user