diff options
| author | treeston <treeston.mmoc@gmail.com> | 2017-07-18 15:55:31 +0200 | 
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-08-19 20:45:58 +0200 | 
| commit | cc9889a3d495961657b1b5918fe1bdac6e7f8817 (patch) | |
| tree | 69abea69d0e7b2992672c07476564d836024c386 /src | |
| parent | 0f741c4a7f5e40f3a03f526feba1d662d284ee63 (diff) | |
Core/Taxi: Properly send taxi node status on login, as well as if the taxi master is out of range. Closes #20035.
(cherry picked from commit 24ec3ad3409e66f523f533ec1d9d573000a5807f)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Handlers/TaxiHandler.cpp | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 9e056f04c68..066fc7910a4 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -42,23 +42,24 @@ void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPackets::Taxi::TaxiNodeS  void WorldSession::SendTaxiStatus(ObjectGuid guid)  { -    // cheating checks -    Creature* unit = ObjectAccessor::GetCreature(*GetPlayer(), guid); -    if (!unit) +    Player* const player = GetPlayer(); +    Creature* unit = ObjectAccessor::GetCreature(*player, guid); +    if (!unit || unit->IsHostileTo(player) || !unit->HasNpcFlag(UNIT_NPC_FLAG_FLIGHTMASTER))      {          TC_LOG_DEBUG("network", "WorldSession::SendTaxiStatus - %s not found.", guid.ToString().c_str());          return;      } -    uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeam()); +    // find taxi node +    uint32 nearest = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), player->GetTeam());      WorldPackets::Taxi::TaxiNodeStatus data;      data.Unit = guid; -    if (!curloc) +    if (!nearest)          data.Status = TAXISTATUS_NONE;      else if (unit->GetReactionTo(GetPlayer()) >= REP_NEUTRAL) -        data.Status = GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) ? TAXISTATUS_LEARNED : TAXISTATUS_UNLEARNED; +        data.Status = GetPlayer()->m_taxi.IsTaximaskNodeKnown(nearest) ? TAXISTATUS_LEARNED : TAXISTATUS_UNLEARNED;      else          data.Status = TAXISTATUS_NOT_ELIGIBLE;  | 
