mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Mail: Reorder mail attachment checks to be able to report nonempty bag error to client. (#28844)
(cherry picked from commit 9658d15b0c)
This commit is contained in:
committed by
Shauren
parent
8898dfec53
commit
7b48268e2c
@@ -202,6 +202,13 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& sendMail)
|
||||
return;
|
||||
}
|
||||
|
||||
// handle empty bag before CanBeTraded, since that func already has that check
|
||||
if (item->IsNotEmptyBag())
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_DESTROY_NONEMPTY_BAG);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!item->CanBeTraded(true))
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_MAIL_BOUND_ITEM);
|
||||
@@ -229,12 +236,6 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& sendMail)
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->IsNotEmptyBag())
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_DESTROY_NONEMPTY_BAG);
|
||||
return;
|
||||
}
|
||||
|
||||
items.push_back(item);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user