feat(Core/ChatHandler): Add SendErrorMessage helper (#17919)

* feat(Core/Chat): Add SendErrorMessage helper

* lost boy
This commit is contained in:
Kitzunu
2023-12-02 19:25:32 +01:00
committed by GitHub
parent 5bfeabde81
commit db4b0b0d3d
40 changed files with 503 additions and 946 deletions

View File

@@ -163,15 +163,13 @@ public:
if (!target)
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
handler->SendErrorMessage(LANG_SELECT_CREATURE);
return false;
}
if (target->GetEntry() == 1)
{
handler->PSendSysMessage("%s%s|r", "|cffff33ff", "You want to load path to a waypoint? Aren't you?");
handler->SetSentErrorMessage(true);
handler->SendErrorMessage("%s%s|r", "|cffff33ff", "You want to load path to a waypoint? Aren't you?");
return false;
}
@@ -772,8 +770,7 @@ public:
if (!target)
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
handler->SendErrorMessage(LANG_SELECT_CREATURE);
return false;
}
@@ -800,8 +797,7 @@ public:
// Check if the user did specify a visual waypoint
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_SELECT);
handler->SetSentErrorMessage(true);
handler->SendErrorMessage(LANG_WAYPOINT_VP_SELECT);
return false;
}
@@ -848,8 +844,7 @@ public:
if (!result)
{
handler->SendSysMessage("|cffff33ffPath no found.|r");
handler->SetSentErrorMessage(true);
handler->SendErrorMessage("|cffff33ffPath no found.|r");
return false;
}
@@ -958,8 +953,7 @@ public:
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUND, pathid);
handler->SetSentErrorMessage(true);
handler->SendErrorMessage(LANG_WAYPOINT_NOTFOUND, pathid);
return false;
}
@@ -1008,8 +1002,7 @@ public:
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDLAST, pathid);
handler->SetSentErrorMessage(true);
handler->SendErrorMessage(LANG_WAYPOINT_NOTFOUNDLAST, pathid);
return false;
}
@@ -1056,8 +1049,7 @@ public:
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
{
handler->SendSysMessage(LANG_WAYPOINT_VP_NOTFOUND);
handler->SetSentErrorMessage(true);
handler->SendErrorMessage(LANG_WAYPOINT_VP_NOTFOUND);
return false;
}