Core/FlightPath: teleport players at destination on floor Z when the flight ends

Port From (https://github.com/TrinityCore/TrinityCore/commit/a032d84cf4cf8aca262e6ca6352ad1e82b3e245f)
This commit is contained in:
hondacrx
2021-12-22 20:25:56 -05:00
parent 7a4882731d
commit ca64ca25f6
@@ -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);