Skip to content

Commit

Permalink
Fix camera bug when enabling flying on transport.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Nov 4, 2023
1 parent 36a386f commit bd9cca7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/game/Objects/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit bd9cca7

Please sign in to comment.