From 43a18dae7fa62872933ca8cbfdccd0a96857567b Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 5 Nov 2019 16:05:54 +0100 Subject: [PATCH] Core/PacketIO: Restrict CMSG_STANDSTATECHANGE to only allow the same stand states that client can send by itself --- src/server/game/Handlers/MiscHandler.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index c612fe3f7df..545ae619e25 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -530,10 +530,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); }