mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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 6a0a800535)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user