Core/Misc: Fix current player state when logging out

Sit should only be apply'd when player is standing.
For example when sitting on a chair when logging out, player should stay on the chair until fully logged out and not sit on the floor.
This commit is contained in:
Kittnz
2014-10-12 19:23:40 +02:00
parent a9cd76f101
commit 68293aa9b2

View File

@@ -414,7 +414,8 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/)
// not set flags if player can't free move to prevent lost state at logout cancel
if (GetPlayer()->CanFreeMove())
{
GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);
if (GetPlayer()->getStandState() == UNIT_STAND_STATE_STAND)
GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);
WorldPacket data(SMSG_FORCE_MOVE_ROOT, (8+4)); // guess size
data << GetPlayer()->GetPackGUID();