From 35d95a7b87423f1997258b239398e4547cfc58ba Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 6 Jul 2019 14:03:45 +0200 Subject: [PATCH] Core/FlightPath: teleport players at destination on floor Z when the flight ends, instead of having them fall from the air (ported commit: 6a0a800535f6de9f6028a5375abfaf1dae8c7c28) --- .../MovementGenerators/FlightPathMovementGenerator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp index 990d6da6e6c..e9b53d969c0 100644 --- a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp @@ -119,7 +119,10 @@ void FlightPathMovementGenerator::DoFinalize(Player* player) // this prevent cheating with landing point at lags // when client side flight end early in comparison server side player->StopMoving(); - player->SetFallInformation(0, player->GetPositionZ()); + float mapHeight = player->GetMap()->GetHeight(player->GetPhaseShift(), _path[GetCurrentNode()]->LocX, _path[GetCurrentNode()]->LocY, _path[GetCurrentNode()]->LocZ); + player->SetFallInformation(0, mapHeight); + // When the player reaches the last flight point, teleport to destination at map height + player->TeleportTo(_path[GetCurrentNode()]->MapID, _path[GetCurrentNode()]->LocX, _path[GetCurrentNode()]->LocY, mapHeight, player->GetOrientation()); } player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);