Core/Players: merged a fix for frozen emotes in specific circumstances

This commit is contained in:
Ovahlord
2018-03-25 20:40:03 +02:00
parent b958176025
commit b60589fa9f
3 changed files with 8 additions and 6 deletions

View File

@@ -700,8 +700,10 @@ void WorldSession::HandleEmoteOpcode(WorldPacket& recvData)
uint32 emote;
recvData >> emote;
sScriptMgr->OnPlayerEmote(GetPlayer(), emote);
GetPlayer()->HandleEmoteCommand(emote);
sScriptMgr->OnPlayerClearEmote(GetPlayer());
if (_player->GetUInt32Value(UNIT_NPC_EMOTESTATE))
_player->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
}
namespace Trinity

View File

@@ -1904,9 +1904,9 @@ void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::stri
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, channel);
}
void ScriptMgr::OnPlayerEmote(Player* player, uint32 emote)
void ScriptMgr::OnPlayerClearEmote(Player* player)
{
FOREACH_SCRIPT(PlayerScript)->OnEmote(player, emote);
FOREACH_SCRIPT(PlayerScript)->OnClearEmote(player);
}
void ScriptMgr::OnPlayerTextEmote(Player* player, uint32 textEmote, uint32 emoteNum, ObjectGuid guid)

View File

@@ -662,7 +662,7 @@ class TC_GAME_API PlayerScript : public UnitScript
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Channel* /*channel*/) { }
// Both of the below are called on emote opcodes.
virtual void OnEmote(Player* /*player*/, uint32 /*emote*/) { }
virtual void OnClearEmote(Player* /*player*/) { }
virtual void OnTextEmote(Player* /*player*/, uint32 /*textEmote*/, uint32 /*emoteNum*/, ObjectGuid /*guid*/) { }
@@ -998,7 +998,7 @@ class TC_GAME_API ScriptMgr
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group);
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild);
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Channel* channel);
void OnPlayerEmote(Player* player, uint32 emote);
void OnPlayerClearEmote(Player* player);
void OnPlayerTextEmote(Player* player, uint32 textEmote, uint32 emoteNum, ObjectGuid guid);
void OnPlayerSpellCast(Player* player, Spell* spell, bool skipCheck);
void OnPlayerLogin(Player* player, bool firstLogin);