Player/Emotes: Fix infinite dance and read map animation

Thx to @Kinzcool and @SeTM for the info

based on 57ceeae828
This commit is contained in:
Dekadencee 2015-02-03 14:40:11 +00:00 committed by Antz
parent 3c22e82937
commit 6578d0c7e1
2 changed files with 7 additions and 0 deletions

View file

@ -725,6 +725,9 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recv_data)
case EMOTE_STATE_KNEEL: case EMOTE_STATE_KNEEL:
case EMOTE_ONESHOT_NONE: case EMOTE_ONESHOT_NONE:
break; break;
case EMOTE_STATE_DANCE:
case EMOTE_STATE_READ:
GetPlayer()->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote_id);
default: default:
{ {
// in feign death state allowed only text emotes. // in feign death state allowed only text emotes.

View file

@ -344,6 +344,10 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recv_data)
if (plMover) if (plMover)
plMover->UpdateFallInformationIfNeed(movementInfo, opcode); plMover->UpdateFallInformationIfNeed(movementInfo, opcode);
// stop some emotes at player move
if (mover && (mover->GetUInt32Value(UNIT_NPC_EMOTESTATE) != 0))
mover->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
WorldPacket data(SMSG_PLAYER_MOVE, recv_data.size()); WorldPacket data(SMSG_PLAYER_MOVE, recv_data.size());
data << movementInfo; data << movementInfo;
mover->SendMessageToSetExcept(&data, _player); mover->SendMessageToSetExcept(&data, _player);