From ca64ca25f63755333fae2d84e9417a15ae3fc458 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 22 Dec 2021 20:25:56 -0500 Subject: [PATCH] Core/FlightPath: teleport players at destination on floor Z when the flight ends Port From (https://github.com/TrinityCore/TrinityCore/commit/a032d84cf4cf8aca262e6ca6352ad1e82b3e245f) --- .../Game/Movement/Generators/FlightPathMovementGenerator.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Game/Movement/Generators/FlightPathMovementGenerator.cs b/Source/Game/Movement/Generators/FlightPathMovementGenerator.cs index aee83ebe2..5e5a59221 100644 --- a/Source/Game/Movement/Generators/FlightPathMovementGenerator.cs +++ b/Source/Game/Movement/Generators/FlightPathMovementGenerator.cs @@ -133,7 +133,10 @@ namespace Game.Movement // 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[(int)GetCurrentNode()].Loc.X, _path[(int)GetCurrentNode()].Loc.Y, _path[(int)GetCurrentNode()].Loc.Z); + owner.SetFallInformation(0, mapHeight); + // When the player reaches the last flight point, teleport to destination at map height + owner.TeleportTo(_path[(int)GetCurrentNode()].ContinentID, _path[(int)GetCurrentNode()].Loc.X, _path[(int)GetCurrentNode()].Loc.Y, mapHeight, owner.GetOrientation()); } owner.RemovePlayerFlag(PlayerFlags.TaxiBenchmark);