diff options
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;  | 
