[7135] Implement support for single taxi master with different path for teams.

Side effect: quest taxi flights (without mount id provided) will impossible start from normal taxi master.
But for its expected starting from scripts.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
GriffonHeart 2009-01-21 16:58:12 +03:00 committed by VladimirMangos
parent 7766d016ca
commit d9d30fd40e
4 changed files with 7 additions and 7 deletions

View file

@ -4752,7 +4752,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
sLog.outString( ">> Loaded %u areatrigger scripts", count ); sLog.outString( ">> Loaded %u areatrigger scripts", count );
} }
uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid ) uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team )
{ {
bool found = false; bool found = false;
float dist; float dist;
@ -4761,7 +4761,7 @@ uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid )
for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i) for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
{ {
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i); TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
if(node && node->map_id == mapid) if(node && node->map_id == mapid && node->MountCreatureID[team == ALLIANCE ? 1 : 0])
{ {
float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z); float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z);
if(found) if(found)

View file

@ -409,7 +409,7 @@ class ObjectMgr
uint32 GetPlayerAccountIdByGUID(const uint64 &guid) const; uint32 GetPlayerAccountIdByGUID(const uint64 &guid) const;
uint32 GetPlayerAccountIdByPlayerName(const std::string& name) const; uint32 GetPlayerAccountIdByPlayerName(const std::string& name) const;
uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid ); uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team );
void GetTaxiPath( uint32 source, uint32 destination, uint32 &path, uint32 &cost); void GetTaxiPath( uint32 source, uint32 destination, uint32 &path, uint32 &cost);
uint16 GetTaxiMount( uint32 id, uint32 team ); uint16 GetTaxiMount( uint32 id, uint32 team );
void GetTaxiPathNodes( uint32 path, Path &pathnodes, std::vector<uint32>& mapIds ); void GetTaxiPathNodes( uint32 path, Path &pathnodes, std::vector<uint32>& mapIds );

View file

@ -54,7 +54,7 @@ void WorldSession::SendTaxiStatus( uint64 guid )
return; return;
} }
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId()); uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
// not found nearest // not found nearest
if(curloc == 0) if(curloc == 0)
@ -101,7 +101,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
void WorldSession::SendTaxiMenu( Creature* unit ) void WorldSession::SendTaxiMenu( Creature* unit )
{ {
// find current node // find current node
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId()); uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
if ( curloc == 0 ) if ( curloc == 0 )
return; return;
@ -134,7 +134,7 @@ void WorldSession::SendDoFlight( uint16 MountId, uint32 path, uint32 pathNode )
bool WorldSession::SendLearnNewTaxiNode( Creature* unit ) bool WorldSession::SendLearnNewTaxiNode( Creature* unit )
{ {
// find current node // find current node
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId()); uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
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.

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7134" #define REVISION_NR "7135"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__