[8764] Simplify code for mail items send. Avoid packet unread spam at errors.

This commit is contained in:
VladimirMangos 2009-11-02 14:44:29 +03:00
parent 132aed0f0b
commit d5dad82f3d
9 changed files with 86 additions and 126 deletions

View file

@ -3963,7 +3963,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
continue;
}
mi.AddItem(item_guidlow, item_template, pItem);
mi.AddItem(pItem);
}
while (resultItems->NextRow());
@ -14949,7 +14949,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
Item* item = problematicItems.front();
problematicItems.pop_front();
mi.AddItem(item->GetGUIDLow(), item->GetEntry(), item);
mi.AddItem(item);
}
std::string subject = GetSession()->GetMangosString(LANG_NOT_EQUIPPED_ITEM);
@ -18823,7 +18823,7 @@ void Player::AutoUnequipOffhandIfNeed()
else
{
MailItemsInfo mi;
mi.AddItem(offItem->GetGUIDLow(), offItem->GetEntry(), offItem);
mi.AddItem(offItem);
MoveItemFromInventory(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND, true);
CharacterDatabase.BeginTransaction();
offItem->DeleteFromInventoryDB(); // deletes item from character's inventory