diff options
author | ForesterDev <11771800+ForesterDev@users.noreply.github.com> | 2020-02-28 22:29:05 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 19:29:05 +0100 |
commit | f6e6baa2932788b17169ba103b62a6f66ee7290a (patch) | |
tree | c3e263d1c8fd67de4758b49318e2e0b80fb0b57e /src/server/game/Handlers/ChatHandler.cpp | |
parent | 71a01c75caa767c3323e295a596fe430dc8c7fb2 (diff) |
Core/PacketIO: update SMSG_EMOTE / CMSG_EMOTE packets to new system (#24200)
* Core/PacketIO: update SMSG_EMOTE / CMSG_EMOTE packets to new system
* Change int32 to uint32
Diffstat (limited to 'src/server/game/Handlers/ChatHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/ChatHandler.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 1d11c671d24..cb3cb3e33a4 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -22,6 +22,7 @@ #include "Channel.h" #include "ChannelMgr.h" #include "Chat.h" +#include "ChatPackets.h" #include "DatabaseEnv.h" #include "DBCStores.h" #include "GameTime.h" @@ -568,20 +569,19 @@ 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; - - 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; + + if (!_player->IsAlive() || _player->HasUnitState(UNIT_STATE_DIED)) return; - sScriptMgr->OnPlayerEmote(GetPlayer(), emote); - GetPlayer()->HandleEmoteCommand(emote); + sScriptMgr->OnPlayerEmote(_player, emoteId); + _player->HandleEmoteCommand(emoteId); } namespace Trinity |