mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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 24ec3ad340)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user