From bd9cca7b9d16d3e88c15ed378a893faebaf353f1 Mon Sep 17 00:00:00 2001 From: ratkosrb Date: Sun, 5 Nov 2023 00:57:15 +0200 Subject: [PATCH] Fix camera bug when enabling flying on transport. --- src/game/Objects/Player.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index c381068ddbe..0de3a8be9e2 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -4949,6 +4949,14 @@ void Player::SetFly(bool enable) { if (enable) { + if (GenericTransport* pTransport = GetTransport()) + { + // Remove client from transport by sending regular monster move packet. + // Otherwise camera will bug out and get stuck in a weird position. + pTransport->RemovePassenger(this); + StopMoving(true); + } + m_movementInfo.moveFlags = (MOVEFLAG_LEVITATING | MOVEFLAG_SWIMMING | MOVEFLAG_CAN_FLY | MOVEFLAG_FLYING); AddUnitState(UNIT_STAT_FLYING_ALLOWED); }