diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index f9746b053bf..2e96825c7d7 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -20214,13 +20214,23 @@ void Player::OnTaxiFlightStart(const TaxiPathEntry* /*path*/) void Player::OnTaxiFlightEnd(const TaxiPathEntry* path) { - // Final destination - if (const TaxiNodesEntry* destination = sTaxiNodesStore.LookupEntry(path->to)) - TeleportTo(GetMap()->GetId(), destination->x, destination->y, destination->z, GetOrientation()); + RemoveFlag(UNIT_FIELD_FLAGS, (UNIT_FLAG_CLIENT_CONTROL_LOST | UNIT_FLAG_TAXI_FLIGHT)); + + RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK); + + // Client-controlled unit should have control restored + if (const Player* controllingClientPlayer = GetClientControlling()) + UpdateClientControl(this, true); + + Unmount(); if (pvpInfo.inPvPEnforcedArea) CastSpell(this, 2479, TRIGGERED_OLD_TRIGGERED); + // Final destination + if (const TaxiNodesEntry* destination = sTaxiNodesStore.LookupEntry(path->to)) + TeleportTo(GetMap()->GetId(), destination->x, destination->y, destination->z, GetOrientation()); + /* NOTE: B clearly has some form of extra scripts on certain fly path ends. Nodes contain extra events, that can be done using dbscript_on_event, but these extra scripts have no EventID in the DBC. In future if this place fills up, need to consider moving it to a more generic way of scripting. @@ -20315,8 +20325,6 @@ void Player::OnTaxiFlightSplineStart(const TaxiPathNodeEntry* node) void Player::OnTaxiFlightSplineEnd() { - Unmount(); - getHostileRefManager().updateOnlineOfflineState(true); // Note: only gets set by itself when container does not end up empty diff --git a/src/game/MotionGenerators/MovementHandler.cpp b/src/game/MotionGenerators/MovementHandler.cpp index df33baf8da5..25da7414ee1 100644 --- a/src/game/MotionGenerators/MovementHandler.cpp +++ b/src/game/MotionGenerators/MovementHandler.cpp @@ -852,7 +852,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recv_data) bool WorldSession::ProcessMovementInfo(MovementInfo& movementInfo, Unit* mover, Player* plMover, WorldPacket& recv_data) { - if (plMover && plMover->IsBeingTeleported()) + if (plMover && plMover->IsBeingTeleported() && recv_data.GetOpcode() != CMSG_MOVE_SET_COLLISION_HGT_ACK) return false; if (!VerifyMovementInfo(movementInfo, mover, recv_data.GetOpcode() == CMSG_FORCE_MOVE_UNROOT_ACK)) diff --git a/src/game/MotionGenerators/PathMovementGenerator.cpp b/src/game/MotionGenerators/PathMovementGenerator.cpp index b4d046be5b3..32d7c9d11c5 100644 --- a/src/game/MotionGenerators/PathMovementGenerator.cpp +++ b/src/game/MotionGenerators/PathMovementGenerator.cpp @@ -333,14 +333,20 @@ void TaxiMovementGenerator::Initialize(Unit& unit) void TaxiMovementGenerator::Finalize(Unit& unit) { unit.clearUnitState(UNIT_STAT_TAXI_FLIGHT); - unit.RemoveFlag(UNIT_FIELD_FLAGS, (UNIT_FLAG_CLIENT_CONTROL_LOST | UNIT_FLAG_TAXI_FLIGHT)); - if (unit.GetTypeId() == TYPEID_PLAYER) - unit.RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK); + if (unit.HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_TAXI_FLIGHT)) // cleanup if still present, otherwise done in Player::OnTaxiFlightEnd + { + unit.RemoveFlag(UNIT_FIELD_FLAGS, (UNIT_FLAG_CLIENT_CONTROL_LOST | UNIT_FLAG_TAXI_FLIGHT)); - // Client-controlled unit should have control restored - if (const Player* controllingClientPlayer = unit.GetClientControlling()) - controllingClientPlayer->UpdateClientControl(&unit, true); + if (unit.GetTypeId() == TYPEID_PLAYER) + unit.RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK); + + // Client-controlled unit should have control restored + if (const Player* controllingClientPlayer = unit.GetClientControlling()) + controllingClientPlayer->UpdateClientControl(&unit, true); + + unit.Unmount(); + } AbstractPathMovementGenerator::Finalize(unit); }