diff options
| author | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-08-15 15:29:43 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-26 21:46:51 +0100 |
| commit | 2e3c612c808bca7601b32ce5dca28b204e652773 (patch) | |
| tree | 61f88efa0f2bc5781183ad5c8989b508f46b634c /src/server/scripts/Spells | |
| parent | 595e89e02bec7300b3dd42afc5899a64f79aecba (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/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 28bb777f866..5ebaaae0049 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3094,14 +3094,7 @@ class spell_gen_seaforium_blast : public SpellScript } }; -enum SpectatorCheerTrigger -{ - EMOTE_ONE_SHOT_CHEER = 4, - EMOTE_ONE_SHOT_EXCLAMATION = 5, - EMOTE_ONE_SHOT_APPLAUD = 21 -}; - -uint8 const EmoteArray[3] = { EMOTE_ONE_SHOT_CHEER, EMOTE_ONE_SHOT_EXCLAMATION, EMOTE_ONE_SHOT_APPLAUD }; +static Emote const EmoteArray[] = { EMOTE_ONESHOT_CHEER, EMOTE_ONESHOT_EXCLAMATION, EMOTE_ONESHOT_APPLAUD }; class spell_gen_spectator_cheer_trigger : public SpellScript { @@ -3110,7 +3103,7 @@ class spell_gen_spectator_cheer_trigger : public SpellScript void HandleDummy(SpellEffIndex /*effIndex*/) { if (roll_chance_i(40)) - GetCaster()->HandleEmoteCommand(EmoteArray[urand(0, 2)]); + GetCaster()->HandleEmoteCommand(Trinity::Containers::SelectRandomContainerElement(EmoteArray)); } void Register() override |
