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)
This commit is contained in:
committed by
GitHub
parent
48f9a807f3
commit
9658d15b0c
@@ -191,6 +191,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_CAN_ONLY_DO_WITH_EMPTY_BAGS);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!item->CanBeTraded(true))
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_MAIL_BOUND_ITEM);
|
||||
@@ -215,12 +222,6 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& sendMail)
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->IsNotEmptyBag())
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS);
|
||||
return;
|
||||
}
|
||||
|
||||
items.push_back(item);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user