Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Server/PacketIO: Only send SMSG_EMOTE when we are dancing.
Browse files Browse the repository at this point in the history
  • Loading branch information
AriDEV3 committed Nov 18, 2023
1 parent 04e3e12 commit 593a353
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,12 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)

void Unit::HandleEmoteCommand(uint32 anim_id)
{
if (GetUInt32Value(UNIT_FIELD_NPC_EMOTESTATE) == 483)
if (anim_id == 10)
{
SetUInt32Value(UNIT_FIELD_NPC_EMOTESTATE, anim_id);
return;
}
else if (GetUInt32Value(UNIT_FIELD_NPC_EMOTESTATE) == 483)
{
SetUInt32Value(UNIT_FIELD_NPC_EMOTESTATE, 0x0);
return;
Expand Down
11 changes: 7 additions & 4 deletions src/server/game/Handlers/MovementHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,13 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)

mover->UpdatePosition(movementInfo.pos);

WorldPacket data2(SMSG_EMOTE, 4 + 8);
data2 << uint32(0x00);
data2 << uint64(mover->GetGUID());
mover->SendMessageToSet(&data2, true);
if (mover->GetUInt32Value(UNIT_FIELD_NPC_EMOTESTATE) == 10)
{
WorldPacket data2(SMSG_EMOTE, 4 + 8);
data2 << uint32(0x00);
data2 << uint64(mover->GetGUID());
mover->SendMessageToSet(&data2, true);
}

WorldPacket data(SMSG_PLAYER_MOVE, recvPacket.size());
mover->WriteMovementInfo(data);
Expand Down

0 comments on commit 593a353

Please sign in to comment.