mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +00:00
feat(Core/ChatHandler): Add SendErrorMessage helper (#17919)
* feat(Core/Chat): Add SendErrorMessage helper * lost boy
This commit is contained in:
@@ -89,15 +89,13 @@ public:
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemID);
|
||||
if (!itemTemplate)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemID);
|
||||
handler->SetSentErrorMessage(true);
|
||||
handler->SendErrorMessage(LANG_COMMAND_ITEMIDINVALID, itemID);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!itemCount || (itemTemplate->MaxCount > 0 && itemCount > uint32(itemTemplate->MaxCount)))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, itemCount, itemID);
|
||||
handler->SetSentErrorMessage(true);
|
||||
handler->SendErrorMessage(LANG_COMMAND_INVALID_ITEM_COUNT, itemCount, itemID);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -111,8 +109,7 @@ public:
|
||||
|
||||
if (itemList.size() > MAX_MAIL_ITEMS)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS);
|
||||
handler->SetSentErrorMessage(true);
|
||||
handler->SendErrorMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user