Core/PacketIO: Restrict CMSG_STANDSTATECHANGE to only allow the same stand states that client can send by itself

This commit is contained in:
Shauren
2019-10-27 11:15:15 +01:00
parent 369cfc29d9
commit 267bdde323

View File

@@ -496,10 +496,20 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket& recvData)
void WorldSession::HandleStandStateChangeOpcode(WorldPacket& recvData)
{
// TC_LOG_DEBUG("network", "WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop
uint32 animstate;
recvData >> animstate;
switch (animstate)
{
case UNIT_STAND_STATE_STAND:
case UNIT_STAND_STATE_SIT:
case UNIT_STAND_STATE_SLEEP:
case UNIT_STAND_STATE_KNEEL:
break;
default:
return;
}
_player->SetStandState(animstate);
}