Core/ChatCommands: Check whether a passed numeric enum value is valid (#25285)

(cherry picked from commit 4286e7aa02e777268b25d8a5bcc1ee87f7b16c4d)
This commit is contained in:
Peter Keresztes Schmidt
2022-02-03 00:18:48 +01:00
committed by Shauren
parent 3ba767c438
commit 3c82863c52
13 changed files with 1610 additions and 36 deletions
+2 -8
View File
@@ -1163,14 +1163,8 @@ public:
if (Unit* unit = handler->getSelectedUnit())
unit->HandleEmoteCommand(emote);
try
{
handler->PSendSysMessage("Playing emote %s", EnumUtils::ToConstant(emote));
}
catch (...)
{
handler->PSendSysMessage("Playing unknown emote");
}
handler->PSendSysMessage("Playing emote %s", EnumUtils::ToConstant(emote));
return true;
}