[10862] Fixed not show and lost mail items in returned expire mails.

Also
* Use typename for mail item info vector.
* Include tools/characters_mail_items_cleanup.sql for cleanup lost mail items.
  It also included as sql update part. Sql update also fix receiver for stored
  in DB expired mail items.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Quriq14 2010-12-12 09:02:43 +03:00 committed by VladimirMangos
parent f72e2ccee8
commit c7205a6837
10 changed files with 44 additions and 13 deletions

View file

@ -15171,6 +15171,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder *holder )
SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64());
SetUInt32Value(PLAYER_AMMO_ID, fields[62].GetUInt32());
// Action bars state
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[64].GetUInt8());
// cleanup inventory related item value fields (its will be filled correctly in _LoadInventory)
@ -17293,7 +17295,7 @@ void Player::_SaveMail()
else if (m->state == MAIL_STATE_DELETED)
{
if (m->HasItems())
for(std::vector<MailItemInfo>::const_iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
for(MailItemInfoVec::const_iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid = '%u'", itr2->item_guid);
CharacterDatabase.PExecute("DELETE FROM mail WHERE id = '%u'", m->messageID);