aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorPeter Keresztes Schmidt <carbenium@outlook.com>2020-08-15 15:29:43 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-26 21:46:51 +0100
commit2e3c612c808bca7601b32ce5dca28b204e652773 (patch)
tree61f88efa0f2bc5781183ad5c8989b508f46b634c /src/server/scripts/Commands
parent595e89e02bec7300b3dd42afc5899a64f79aecba (diff)
Core/Unit: Make HandleEmoteCommand typesafe (#25249)
* Scripts/ScarletMonastery: Fix wrong emote during Headless Horseman encounter * Scripts/HoR: Fix wrong emote during escape event * Core/Unit: Make improve type safety of HandleEmoteCommand Change argument type to the expected enum type Emote * Scripts/CoS: Use SetUInt32Value to set UNIT_NPC_EMOTESTATE UNIT_NPC_EMOTESTATE is no flag field (cherry picked from commit 6c7837f947ff4eb5110a116a371daa6f9e2b3bbe)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 7f1dc590e4c..e82a314798e 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1256,14 +1256,10 @@ public:
}
//show animation
- static bool HandleDebugAnimCommand(ChatHandler* handler, char const* args)
+ static bool HandleDebugAnimCommand(ChatHandler* handler, uint32 emoteId)
{
- if (!*args)
- return false;
-
- uint32 animId = atoi((char*)args);
if (Unit* unit = handler->getSelectedUnit())
- unit->HandleEmoteCommand(animId);
+ unit->HandleEmoteCommand(static_cast<Emote>(emoteId));
return true;
}