mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-25 16:09:20 -04:00
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
This commit is contained in:
committed by
GitHub
parent
34d403e83f
commit
6c7837f947
@@ -3200,14 +3200,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
|
||||
{
|
||||
@@ -3216,7 +3209,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
|
||||
|
||||
Reference in New Issue
Block a user