aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2019-10-08 11:11:24 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-18 22:45:49 +0100
commit14c2a7fb92e49265071f36b65fb845ecc6dd4381 (patch)
tree3274fc40eee649ddc07298967936b042b373efae /src
parent4062c9763ff1230830bc18bb22308a5d3a7c152d (diff)
Core/Taxis: teleport players to the destination taxi node location instead of their current ground position (#23835)
* Core/Taxis: teleport players to the destination taxi node location instead of straight to their current ground position * fixed a typo (cherry picked from commit 7fcb77ecd12c42b8a468e8f932948c99c249a458)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp
index ea01bcca42f..28bc55f33bb 100644
--- a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp
@@ -149,6 +149,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* owner, bool active, bool/*
if (!active)
return;
+ uint32 taxiNodeId = owner->m_taxi.GetTaxiDestination();
owner->m_taxi.ClearTaxiDestinations();
owner->Dismount();
owner->RemoveUnitFlag(UnitFlags(UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT));
@@ -159,10 +160,13 @@ 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();
- 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());
+
+ // When the player reaches the last flight point, teleport to destination taxi node location
+ if (TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(taxiNodeId))
+ {
+ owner->SetFallInformation(0, node->Pos.Z);
+ owner->TeleportTo(node->ContinentID, node->Pos.X, node->Pos.Y, node->Pos.Z, owner->GetOrientation());
+ }
}
owner->RemovePlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK);