Core/Chat: Disallow visual emotes when an entity is in dead-state (thanks to Vladimir)

Closes issue 4942.

--HG--
branch : trunk
This commit is contained in:
click
2010-11-28 20:12:33 +01:00
parent 916c0f98df
commit 3fccb2b7bf

View File

@@ -580,7 +580,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data)
{
if (!GetPlayer()->isAlive())
if (!GetPlayer()->isAlive() || GetPlayer()->hasUnitState(UNIT_STAT_DIED))
return;
uint32 emote;
@@ -656,8 +656,11 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data)
case EMOTE_ONESHOT_NONE:
break;
default:
GetPlayer()->HandleEmoteCommand(emote_anim);
break;
// Only allow text-emotes for "dead" entities (feign death included)
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
break;
GetPlayer()->HandleEmoteCommand(emote_anim);
break;
}
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);