fix(Core/Taxi): Use original team for flight path lookups (#25165)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10441,7 +10441,7 @@ void Player::SendTaxiNodeStatusMultiple()
|
|||||||
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_FLIGHTMASTER))
|
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_FLIGHTMASTER))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 nearestNode = sObjectMgr->GetNearestTaxiNode(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetMapId(), GetTeamId());
|
uint32 nearestNode = sObjectMgr->GetNearestTaxiNode(*creature, GetTeamId(true));
|
||||||
if (!nearestNode)
|
if (!nearestNode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -7160,6 +7160,11 @@ void ObjectMgr::LoadAreaTriggerScripts()
|
|||||||
LOG_INFO("server.loading", " ");
|
LOG_INFO("server.loading", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 ObjectMgr::GetNearestTaxiNode(WorldLocation const& loc, uint32 teamId)
|
||||||
|
{
|
||||||
|
return GetNearestTaxiNode(loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), loc.GetMapId(), teamId);
|
||||||
|
}
|
||||||
|
|
||||||
uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 teamId)
|
uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 teamId)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|||||||
@@ -811,6 +811,7 @@ public:
|
|||||||
void GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo* info) const;
|
void GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo* info) const;
|
||||||
|
|
||||||
uint32 GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 teamId);
|
uint32 GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 teamId);
|
||||||
|
uint32 GetNearestTaxiNode(WorldLocation const& loc, uint32 teamId);
|
||||||
void GetTaxiPath(uint32 source, uint32 destination, uint32& path, uint32& cost);
|
void GetTaxiPath(uint32 source, uint32 destination, uint32& path, uint32& cost);
|
||||||
uint32 GetTaxiMountDisplayId(uint32 id, TeamId teamId, bool allowed_alt_team = false);
|
uint32 GetTaxiMountDisplayId(uint32 id, TeamId teamId, bool allowed_alt_team = false);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ void WorldSession::SendTaxiStatus(ObjectGuid guid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find taxi node
|
// find taxi node
|
||||||
uint32 nearest = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), player->GetTeamId());
|
uint32 nearest = sObjectMgr->GetNearestTaxiNode(*unit, player->GetTeamId(true));
|
||||||
if (!nearest)
|
if (!nearest)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -84,7 +84,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket& recvData)
|
|||||||
void WorldSession::SendTaxiMenu(Creature* unit)
|
void WorldSession::SendTaxiMenu(Creature* unit)
|
||||||
{
|
{
|
||||||
// find current node
|
// find current node
|
||||||
uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeamId());
|
uint32 curloc = sObjectMgr->GetNearestTaxiNode(*unit, GetPlayer()->GetTeamId(true));
|
||||||
|
|
||||||
if (curloc == 0)
|
if (curloc == 0)
|
||||||
return;
|
return;
|
||||||
@@ -127,7 +127,7 @@ void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathN
|
|||||||
bool WorldSession::SendLearnNewTaxiNode(Creature* unit)
|
bool WorldSession::SendLearnNewTaxiNode(Creature* unit)
|
||||||
{
|
{
|
||||||
// find current node
|
// find current node
|
||||||
uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeamId());
|
uint32 curloc = sObjectMgr->GetNearestTaxiNode(*unit, GetPlayer()->GetTeamId(true));
|
||||||
|
|
||||||
if (curloc == 0)
|
if (curloc == 0)
|
||||||
return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result.
|
return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result.
|
||||||
|
|||||||
Reference in New Issue
Block a user