aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-06-19 15:17:21 +0200
committerGiacomo Pozzoni <giacomopoz@gmail.com>2019-06-19 15:17:21 +0200
commit6a0a800535f6de9f6028a5375abfaf1dae8c7c28 (patch)
tree80e7668bcb7e40e72fc93ba3d0c4d70ccd9a9d3b
parentc650369e633b28c5efa2eed0de0a020842ef2e1f (diff)
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
-rw-r--r--src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp
index 3ad30ecce90..e5d08696b6b 100644
--- a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp
@@ -150,7 +150,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(_path[GetCurrentNode()]->LocX, _path[GetCurrentNode()]->LocY, _path[GetCurrentNode()]->LocZ);
+ owner->SetFallInformation(0, mapHeight);
+ // When the player reaches the last flight point, teleport to destination at map height
+ owner->TeleportTo(_path[GetCurrentNode()]->MapID, _path[GetCurrentNode()]->LocX, _path[GetCurrentNode()]->LocY, mapHeight, owner->GetOrientation());
}
owner->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);