diff options
author | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-08-16 16:26:47 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-26 22:16:05 +0100 |
commit | ec44c8296d155aab8862987848a87a1a81049c12 (patch) | |
tree | 18feb5ebfdd9921874fd8c57ffe8e87b08188a5d /src/server/scripts/Commands | |
parent | d297f65df2b5f44077a220334de179671a070590 (diff) |
Scripts/Commands: Use enum type arg for HandleDebugAnimCommand (PR #25256)
* Core/Shared: Make Emote enum smart
* Scripts/Commands: Use enum type arg for HandleDebugAnimCommand
(cherry picked from commit 86dc58974a46b554042f33df674e3e40ef0cec1e)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index e82a314798e..f7029874f34 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1255,11 +1255,20 @@ public: return true; } - //show animation - static bool HandleDebugAnimCommand(ChatHandler* handler, uint32 emoteId) + // Play emote animation + static bool HandleDebugAnimCommand(ChatHandler* handler, Emote emote) { if (Unit* unit = handler->getSelectedUnit()) - unit->HandleEmoteCommand(static_cast<Emote>(emoteId)); + unit->HandleEmoteCommand(emote); + + try + { + handler->PSendSysMessage("Playing emote %s", EnumUtils::ToConstant(emote)); + } + catch (...) + { + handler->PSendSysMessage("Playing unknown emote"); + } return true; } |