diff --git a/src/game/Entities/CharacterHandler.cpp b/src/game/Entities/CharacterHandler.cpp index f66d2db34e2..669a776f080 100644 --- a/src/game/Entities/CharacterHandler.cpp +++ b/src/game/Entities/CharacterHandler.cpp @@ -1216,9 +1216,7 @@ void WorldSession::HandlePlayerReconnect() GetAccountId(), IP_str.c_str(), _player->GetName(), _player->GetGUIDLow()); // sync client control (if taxi flying the client is already sync) - if (_player->IsTaxiFlying()) - _player->TaxiFlightResume(true); - else if (!_player->IsClientControlled(_player)) + if (!_player->IsTaxiFlying() && !_player->IsClientControlled(_player)) _player->UpdateClientControl(_player, false); // initialize client pet bar if need @@ -1231,7 +1229,8 @@ void WorldSession::HandlePlayerReconnect() _player->SetStandState(UNIT_STAND_STATE_STAND); // Undo flags and states set by logout if present: - _player->SetStunnedByLogout(false); + if (!_player->IsTaxiFlying()) + _player->SetStunnedByLogout(false); // Mark self for unit flags update to ensure re-application of combat flag at own client if (inCombat) diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index 30dc9eb6df4..f9746b053bf 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -710,6 +710,7 @@ Player::Player(WorldSession* session): Unit(), m_taxiTracker(*this), m_mover(thi m_pendingMountAura = false; m_pendingMountAuraFlying = false; m_pendingDismount = false; + m_pendingTaxi = false; } Player::~Player() @@ -1978,8 +1979,11 @@ bool Player::BuildEnumData(QueryResult* result, WorldPacket& p_data) return true; } -bool Player::Mount(uint32 displayid, bool auraExists, int32 auraAmount, bool isFlyingAura) +bool Player::Mount(uint32 displayid, bool auraExists, int32 auraAmount, bool isFlyingAura, bool pendingTaxi) { + if (m_pendingMountId) + return false; + float height = GetCollisionHeight(); uint32 newMountId = GetOverridenMountId() ? GetOverridenMountId() : displayid; float newHeight = CalculateCollisionHeight(newMountId); @@ -1989,11 +1993,9 @@ bool Player::Mount(uint32 displayid, bool auraExists, int32 auraAmount, bool isF m_pendingMountAuraAmount = auraAmount; m_pendingMountAuraFlying = isFlyingAura; m_pendingDismount = false; + m_pendingTaxi = pendingTaxi; - if (height != newHeight) - SendCollisionHeightUpdate(newHeight); - else - ResolvePendingMount(); + SendCollisionHeightUpdate(newHeight); return true; } @@ -2040,9 +2042,17 @@ bool Player::ResolvePendingMount() } } - UpdateSpeed(MOVE_RUN, true); // update speed - if (m_pendingMountAuraFlying) - UpdateSpeed(MOVE_FLIGHT, true); + if (m_pendingMountAura) + { + UpdateSpeed(MOVE_RUN, true); // update speed + if (m_pendingMountAuraFlying) + UpdateSpeed(MOVE_FLIGHT, true); + } + + if (m_pendingTaxi) + GetMotionMaster()->MoveTaxi(); + + m_pendingMountId = 0; return true; } @@ -2064,9 +2074,12 @@ bool Player::ResolvePendingUnmount() else ResummonPetTemporaryUnSummonedIfAny(); - UpdateSpeed(MOVE_RUN, true); // update speed - if (m_pendingMountAuraFlying) - UpdateSpeed(MOVE_FLIGHT, true); + if (m_pendingMountAura) + { + UpdateSpeed(MOVE_RUN, true); // update speed + if (m_pendingMountAuraFlying) + UpdateSpeed(MOVE_FLIGHT, true); + } return true; } @@ -20137,7 +20150,8 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc GetSession()->SendActivateTaxiReply(ERR_TAXIOK); - GetMotionMaster()->MoveTaxi(); + if (m_taxiTracker.GetMountDisplayId()) + Mount(m_taxiTracker.GetMountDisplayId(), false, 0, false, true); return true; } @@ -20159,14 +20173,14 @@ void Player::TaxiFlightResume(bool forceRenewMoveGen /*= false*/) DEBUG_LOG("WORLD: Resuming taxi flight for character %u", GetGUIDLow()); // Already in flight: just make sure client control is updated - if (hasUnitState(UNIT_STAT_TAXI_FLIGHT)) + if (hasUnitState(UNIT_STAT_TAXI_FLIGHT) && !forceRenewMoveGen) { UpdateClientControl(this, IsClientControlled(this)); if (!forceRenewMoveGen) return; } - GetMotionMaster()->MoveTaxi(); + Mount(m_taxiTracker.GetMountDisplayId(), false, 0, false, true); } bool Player::TaxiFlightInterrupt(bool cancel /*= true*/) @@ -20293,9 +20307,6 @@ void Player::OnTaxiFlightSplineStart(const TaxiPathNodeEntry* node) if (m_taxiTracker.GetState() == Taxi::TRACKER_TRANSFER) UpdateClientControl(this, false); - if (sTaxiPathStore.LookupEntry(node->path)) - Mount(m_taxiTracker.GetMountDisplayId()); - getHostileRefManager().updateOnlineOfflineState(false); // Bugcheck: container continuity error diff --git a/src/game/Entities/Player.h b/src/game/Entities/Player.h index 0eb27cb1b57..ec41c1553ca 100644 --- a/src/game/Entities/Player.h +++ b/src/game/Entities/Player.h @@ -1124,7 +1124,7 @@ class Player : public Unit ReputationRank GetReactionTo(Corpse const* corpse) const override; bool IsInGroup(Unit const* other, bool party = false, bool ignoreCharms = false) const override; - bool Mount(uint32 displayid, bool auraExists = false, int32 auraAmount = 0, bool isFlyingAura = false) override; + bool Mount(uint32 displayid, bool auraExists = false, int32 auraAmount = 0, bool isFlyingAura = false, bool pendingTaxi = false) override; bool Unmount(bool auraExists = false, int32 auraAmount = 0, bool isFlyingAura = false) override; bool ResolvePendingMount(); @@ -2994,6 +2994,7 @@ class Player : public Unit int32 m_pendingMountAuraAmount; bool m_pendingMountAuraFlying; bool m_pendingDismount; + bool m_pendingTaxi; }; void AddItemsSetItem(Player* player, Item* item); diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index 45db46564b7..a0446ae69a7 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -8809,7 +8809,7 @@ bool Unit::UnmountEntry(const Aura* aura) return Unmount(aura, aura ? aura->GetAmount() : 0, aura ? IsSpellHaveAura(aura->GetSpellProto(), SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED) : false); } -bool Unit::Mount(uint32 displayid, bool auraExists, int32 auraAmount, bool /*isFlyingAura*/) +bool Unit::Mount(uint32 displayid, bool auraExists, int32 auraAmount, bool /*isFlyingAura*/, bool /*pendingTaxi*/) { // Custom mount (non-aura such as taxi or command) overwrites aura mounts if (!displayid || (IsMounted() && auraExists && uint32(auraAmount) != GetMountID())) diff --git a/src/game/Entities/Unit.h b/src/game/Entities/Unit.h index dcc276ade63..31206e6034e 100644 --- a/src/game/Entities/Unit.h +++ b/src/game/Entities/Unit.h @@ -1539,7 +1539,7 @@ class Unit : public WorldObject uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); } bool MountEntry(uint32 templateEntry, const Aura* aura = nullptr); bool UnmountEntry(const Aura* aura = nullptr); - virtual bool Mount(uint32 displayid, bool auraExists = false, int32 auraAmount = 0, bool isFlyingAura = false); + virtual bool Mount(uint32 displayid, bool auraExists = false, int32 auraAmount = 0, bool isFlyingAura = false, bool pendingTaxi = false); virtual bool Unmount(bool auraExists = false, int32 auraAmount = 0, bool isFlyingAura = false); VehicleInfo* GetVehicleInfo() const { return m_vehicleInfo.get(); }