Core: Give field pointers in Player::DeleteFromDB() more appropriate name
This commit is contained in:
@@ -4819,16 +4819,16 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
{
|
||||
do
|
||||
{
|
||||
Field* fields = resultMail->Fetch();
|
||||
Field* mailFields = resultMail->Fetch();
|
||||
|
||||
uint32 mail_id = fields[0].GetUInt32();
|
||||
uint8 mailType = fields[1].GetUInt8();
|
||||
uint16 mailTemplateId= fields[2].GetUInt16();
|
||||
uint32 sender = fields[3].GetUInt32();
|
||||
std::string subject = fields[4].GetString();
|
||||
std::string body = fields[5].GetString();
|
||||
uint32 money = fields[6].GetUInt32();
|
||||
bool has_items = fields[7].GetBool();
|
||||
uint32 mail_id = mailFields[0].GetUInt32();
|
||||
uint8 mailType = mailFields[1].GetUInt8();
|
||||
uint16 mailTemplateId= mailFields[2].GetUInt16();
|
||||
uint32 sender = mailFields[3].GetUInt32();
|
||||
std::string subject = mailFields[4].GetString();
|
||||
std::string body = mailFields[5].GetString();
|
||||
uint32 money = mailFields[6].GetUInt32();
|
||||
bool has_items = mailFields[7].GetBool();
|
||||
|
||||
// We can return mail now
|
||||
// So firstly delete the old one
|
||||
@@ -4862,9 +4862,9 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
{
|
||||
do
|
||||
{
|
||||
Field* fields2 = resultItems->Fetch();
|
||||
uint32 item_guidlow = fields2[11].GetUInt32();
|
||||
uint32 item_template = fields2[12].GetUInt32();
|
||||
Field* itemFields = resultItems->Fetch();
|
||||
uint32 item_guidlow = itemFields[11].GetUInt32();
|
||||
uint32 item_template = itemFields[12].GetUInt32();
|
||||
|
||||
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_template);
|
||||
if (!itemProto)
|
||||
@@ -4876,7 +4876,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
}
|
||||
|
||||
Item* pItem = NewItemOrBag(itemProto);
|
||||
if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields2, item_template))
|
||||
if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), itemFields, item_template))
|
||||
{
|
||||
pItem->FSetState(ITEM_REMOVED);
|
||||
pItem->SaveToDB(trans); // it also deletes item object!
|
||||
|
||||
Reference in New Issue
Block a user