aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2019-10-08 11:11:24 +0200
committerKittnz <Kittnz@users.noreply.github.com>2019-10-08 11:11:24 +0200
commit7fcb77ecd12c42b8a468e8f932948c99c249a458 (patch)
tree6f339968369cfc76d2bb9a6bfb67c3cb966c0642
parentabcad7cda5375478f475bb9624c578169e84c559 (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
-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 cfcc4e32721..3f47620fc06 100644
--- a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp
@@ -145,6 +145,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->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);
@@ -155,10 +156,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(_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());
+
+ // 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->z);
+ owner->TeleportTo(node->map_id, node->x, node->y, node->z, owner->GetOrientation());
+ }
}
owner->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);