From 6c7837f947ff4eb5110a116a371daa6f9e2b3bbe Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Sat, 15 Aug 2020 15:29:43 +0200 Subject: 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 --- src/server/scripts/Commands/cs_debug.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 5a9c94b384f..eca67c1bf8e 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1243,14 +1243,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(emoteId)); return true; } -- cgit v1.2.3