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:
Wyrserth
2019-06-19 15:17:21 +02:00
committed by Shauren
parent 5331656785
commit a032d84cf4

View File

@@ -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);