aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-06-19 15:17:21 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-11 16:05:31 +0100
commita032d84cf4cf8aca262e6ca6352ad1e82b3e245f (patch)
treea39879d9340bd4bb4fab6607e6ba2b167780ca72 /src
parent5331656785a2b76c060c4e8d4cfb3938c8559efc (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 (cherry picked from commit 6a0a800535f6de9f6028a5375abfaf1dae8c7c28)
Diffstat (limited to 'src')
-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 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);