From a032d84cf4cf8aca262e6ca6352ad1e82b3e245f Mon Sep 17 00:00:00 2001 From: Wyrserth Date: Wed, 19 Jun 2019 15:17:21 +0200 Subject: Core/FlightPath: teleport players at destination on floor Z when the flight ends (#23428) * Core/FlightPath: teleport players at destination on floor Z when the flight ends, instead of having them fall from the air. Closes #10051. * Use the path destination's mapheight instead of the player position's. * Update FlightPathMovementGenerator.cpp (cherry picked from commit 6a0a800535f6de9f6028a5375abfaf1dae8c7c28) --- .../game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp index f75bce43c61..aded7c0524b 100644 --- a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp @@ -154,7 +154,10 @@ void FlightPathMovementGenerator::DoFinalize(Player* owner, bool active, bool/* // this prevent cheating with landing point at lags // when client side flight end early in comparison server side owner->StopMoving(); - owner->SetFallInformation(0, owner->GetPositionZ()); + float mapHeight = owner->GetMap()->GetHeight(owner->GetPhaseShift(), _path[GetCurrentNode()]->Loc.X, _path[GetCurrentNode()]->Loc.Y, _path[GetCurrentNode()]->Loc.Z); + owner->SetFallInformation(0, mapHeight); + // When the player reaches the last flight point, teleport to destination at map height + owner->TeleportTo(_path[GetCurrentNode()]->ContinentID, _path[GetCurrentNode()]->Loc.X, _path[GetCurrentNode()]->Loc.Y, mapHeight, owner->GetOrientation()); } owner->RemovePlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK); -- cgit v1.2.3