Fixed issues with taking items from mail

Closes issue #3263.

--HG--
branch : trunk
This commit is contained in:
Shauren committed 2010-08-04 14:31:47 +02:00
1 parent 1058d7b37d
commit 850868c8a3
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -16864,7 +16864,7 @@ void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff)
void Player::_LoadMailedItems(Mail *mail)
{
// data needs to be at first place for Item::LoadFromDB
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail->messageID);
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, item_template, owner_guid FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail->messageID);
if (!result)
return;
@@ -16888,7 +16888,7 @@ void Player::_LoadMailedItems(Mail *mail)
Item *item = NewItemOrBag(proto);
if (!item->LoadFromDB(item_guid_low, 0, result, item_template))
if (!item->LoadFromDB(item_guid_low, MAKE_NEW_GUID(fields[13].GetUInt32(), 0, HIGHGUID_PLAYER), result, item_template))
{
sLog.outError("Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, item_guid_low);
CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid = '%u'", item_guid_low);