mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
refactor(Core/Packet): Chat (#9509)
* Chat * . * Update GameObject.cpp * Update Object.cpp * Update Player.cpp
This commit is contained in:
committed by
GitHub
parent
03efc110a0
commit
725b1266b4
@@ -19,6 +19,7 @@
|
||||
#include "CellImpl.h"
|
||||
#include "ChannelMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "ChatPackets.h"
|
||||
#include "Common.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
@@ -669,23 +670,22 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleEmoteOpcode(WorldPacket& recvData)
|
||||
void WorldSession::HandleEmoteOpcode(WorldPackets::Chat::EmoteClient& packet)
|
||||
{
|
||||
if (!GetPlayer()->IsAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
return;
|
||||
|
||||
if (GetPlayer()->IsSpectator())
|
||||
return;
|
||||
|
||||
uint32 emote;
|
||||
recvData >> emote;
|
||||
uint32 emoteId = packet.EmoteID;
|
||||
|
||||
// restrict to the only emotes hardcoded in client
|
||||
if (emote != EMOTE_ONESHOT_NONE && emote != EMOTE_ONESHOT_WAVE)
|
||||
if (emoteId != EMOTE_ONESHOT_NONE && emoteId != EMOTE_ONESHOT_WAVE)
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerEmote(GetPlayer(), emote);
|
||||
GetPlayer()->HandleEmoteCommand(emote);
|
||||
if (!_player->IsAlive() || _player->HasUnitState(UNIT_STATE_DIED))
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerEmote(_player, emoteId);
|
||||
_player->HandleEmoteCommand(emoteId);
|
||||
}
|
||||
|
||||
namespace Acore
|
||||
|
||||
Reference in New Issue
Block a user