Core/Unit: Make HandleEmoteCommand typesafe
Port From (https://github.com/TrinityCore/TrinityCore/commit/2e3c612c808bca7601b32ce5dca28b204e652773)
This commit is contained in:
@@ -36,15 +36,12 @@ namespace Game.Chat
|
||||
class DebugCommands
|
||||
{
|
||||
[Command("anim", RBACPermissions.CommandDebugAnim)]
|
||||
static bool HandleDebugAnimCommand(CommandHandler handler, StringArguments args)
|
||||
static bool HandleDebugAnimCommand(CommandHandler handler, uint emoteId)
|
||||
{
|
||||
if (args.Empty())
|
||||
return false;
|
||||
|
||||
uint animId = args.NextUInt32();
|
||||
Unit unit = handler.GetSelectedUnit();
|
||||
if (unit)
|
||||
unit.HandleEmoteCommand((Emote)animId);
|
||||
unit.HandleEmoteCommand((Emote)emoteId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -567,9 +567,9 @@ namespace Game
|
||||
if (em == null)
|
||||
return;
|
||||
|
||||
Emote emoteAnim = (Emote)em.EmoteId;
|
||||
Emote emote = (Emote)em.EmoteId;
|
||||
|
||||
switch (emoteAnim)
|
||||
switch (emote)
|
||||
{
|
||||
case Emote.StateSleep:
|
||||
case Emote.StateSit:
|
||||
@@ -578,13 +578,13 @@ namespace Game
|
||||
break;
|
||||
case Emote.StateDance:
|
||||
case Emote.StateRead:
|
||||
GetPlayer().SetEmoteState(emoteAnim);
|
||||
GetPlayer().SetEmoteState(emote);
|
||||
break;
|
||||
default:
|
||||
// Only allow text-emotes for "dead" entities (feign death included)
|
||||
if (GetPlayer().HasUnitState(UnitState.Died))
|
||||
break;
|
||||
GetPlayer().HandleEmoteCommand(emoteAnim, null, packet.SpellVisualKitIDs);
|
||||
GetPlayer().HandleEmoteCommand(emote, null, packet.SpellVisualKitIDs);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ namespace Game
|
||||
creature.GetAI().ReceiveEmote(GetPlayer(), (TextEmotes)packet.EmoteID);
|
||||
}
|
||||
|
||||
if (emoteAnim != Emote.OneshotNone)
|
||||
if (emote != Emote.OneshotNone)
|
||||
_player.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.Anim);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user