mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 08:59:11 +01:00
Core/Movement: no longer override a player's movementInfo with the info returned from dismissing controlled vehicles as these do not belong to him. This fixes players getting stuck in a disable gravity state when exiting vehicle seats that have disabled a player's gravity
This commit is contained in:
@@ -25987,7 +25987,7 @@ bool Player::SetDisableGravity(bool disable, bool /*packetOnly = false*/, bool /
|
||||
|
||||
if (IsMovedByClient() && IsInWorld())
|
||||
MovementPacketSender::SendMovementFlagChangeToMover(this, MOVEMENTFLAG_DISABLE_GRAVITY, disable);
|
||||
else if (IsMovedByClient() && !IsInWorld()) // (1)
|
||||
else
|
||||
Unit::SetDisableGravity(disable, false, false);
|
||||
|
||||
return true;
|
||||
@@ -26000,7 +26000,7 @@ bool Player::SetCanFly(bool enable, bool /*packetOnly = false*/)
|
||||
|
||||
if (IsMovedByClient() && IsInWorld())
|
||||
MovementPacketSender::SendMovementFlagChangeToMover(this, MOVEMENTFLAG_CAN_FLY, enable);
|
||||
else if (IsMovedByClient() && !IsInWorld()) // (1)
|
||||
else
|
||||
Unit::SetCanFly(enable);
|
||||
|
||||
return true;
|
||||
@@ -26013,7 +26013,7 @@ bool Player::SetCanTransitionBetweenSwimAndFly(bool enable)
|
||||
|
||||
if (IsMovedByClient() && IsInWorld())
|
||||
MovementPacketSender::SendMovementFlagChangeToMover(this, MOVEMENTFLAG2_CAN_SWIM_TO_FLY_TRANS, enable);
|
||||
else if (IsMovedByClient() && !IsInWorld()) // (1)
|
||||
else
|
||||
Unit::SetCanTransitionBetweenSwimAndFly(enable);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -38,10 +38,15 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
MovementInfo mi;
|
||||
_player->ReadMovementInfo(recvData, &mi);
|
||||
MovementInfo movementInfo;
|
||||
_player->ReadMovementInfo(recvData, &movementInfo);
|
||||
|
||||
_player->m_movementInfo = mi;
|
||||
if (movementInfo.guid != vehicleGUID)
|
||||
{
|
||||
TC_LOG_ERROR("network", "Player %s tried to dismiss a controlled vehicle (%s) that he has no control over. Possible cheater or malformed packet.",
|
||||
GetPlayer()->GetGUID().GetCounter(), movementInfo.guid.ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
_player->ExitVehicle();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user