mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
fix(Core/Misc): Consider /dance as an emote state. (#14275)
This commit is contained in:
@@ -14464,6 +14464,9 @@ void Unit::setDeathState(DeathState s, bool despawn)
|
||||
SetHealth(0);
|
||||
SetPower(getPowerType(), 0);
|
||||
|
||||
// Stop emote on death
|
||||
SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
|
||||
// players in instance don't have ZoneScript, but they have InstanceScript
|
||||
if (ZoneScript* zoneScript = GetZoneScript() ? GetZoneScript() : (ZoneScript*)GetInstanceScript())
|
||||
zoneScript->OnUnitDeath(this);
|
||||
|
||||
@@ -755,6 +755,9 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
|
||||
case EMOTE_STATE_KNEEL:
|
||||
case EMOTE_ONESHOT_NONE:
|
||||
break;
|
||||
case EMOTE_STATE_DANCE:
|
||||
GetPlayer()->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote_anim);
|
||||
break;
|
||||
default:
|
||||
// Only allow text-emotes for "dead" entities (feign death included)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
|
||||
@@ -370,6 +370,15 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
|
||||
movementInfo.guid = guid;
|
||||
ReadMovementInfo(recvData, &movementInfo);
|
||||
|
||||
// Stop emote on move
|
||||
if (Player* plrMover = mover->ToPlayer())
|
||||
{
|
||||
if (plrMover->GetUInt32Value(UNIT_NPC_EMOTESTATE) != EMOTE_ONESHOT_NONE)
|
||||
{
|
||||
plrMover->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
if (!movementInfo.pos.IsPositionValid())
|
||||
{
|
||||
if (plrMover)
|
||||
|
||||
Reference in New Issue
Block a user