Core/Mail: Reorder mail attachment checks to be able to report nonempty bag error to client.
Port From (https://github.com/TrinityCore/TrinityCore/commit/7b48268e2cfc7fddeba8fe55721aaab4234cc152)
This commit is contained in:
@@ -186,6 +186,13 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handle empty bag before CanBeTraded, since that func already has that check
|
||||||
|
if (item.IsNotEmptyBag())
|
||||||
|
{
|
||||||
|
player.SendMailResult(0, MailResponseType.Send, MailResponseResult.EquipError, InventoryResult.DestroyNonemptyBag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!item.CanBeTraded(true))
|
if (!item.CanBeTraded(true))
|
||||||
{
|
{
|
||||||
player.SendMailResult(0, MailResponseType.Send, MailResponseResult.EquipError, InventoryResult.MailBoundItem);
|
player.SendMailResult(0, MailResponseType.Send, MailResponseResult.EquipError, InventoryResult.MailBoundItem);
|
||||||
@@ -213,12 +220,6 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.IsNotEmptyBag())
|
|
||||||
{
|
|
||||||
player.SendMailResult(0, MailResponseType.Send, MailResponseResult.EquipError, InventoryResult.DestroyNonemptyBag);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
items.Add(item);
|
items.Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user