From d9d30fd40ef2d2ee60090e1f4322d5d3409b29c1 Mon Sep 17 00:00:00 2001 From: GriffonHeart Date: Wed, 21 Jan 2009 16:58:12 +0300 Subject: [PATCH] [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 --- src/game/ObjectMgr.cpp | 4 ++-- src/game/ObjectMgr.h | 2 +- src/game/TaxiHandler.cpp | 6 +++--- src/shared/revision_nr.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 3b86397a9..a227e1ab3 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -4752,7 +4752,7 @@ void ObjectMgr::LoadAreaTriggerScripts() 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; 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) { 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); if(found) diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index b8b75f0ba..355d8e5ef 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -409,7 +409,7 @@ class ObjectMgr uint32 GetPlayerAccountIdByGUID(const uint64 &guid) 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); uint16 GetTaxiMount( uint32 id, uint32 team ); void GetTaxiPathNodes( uint32 path, Path &pathnodes, std::vector& mapIds ); diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp index ac8f21542..b8aa614db 100644 --- a/src/game/TaxiHandler.cpp +++ b/src/game/TaxiHandler.cpp @@ -54,7 +54,7 @@ void WorldSession::SendTaxiStatus( uint64 guid ) 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 if(curloc == 0) @@ -101,7 +101,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data ) void WorldSession::SendTaxiMenu( Creature* unit ) { // 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 ) return; @@ -134,7 +134,7 @@ void WorldSession::SendDoFlight( uint16 MountId, uint32 path, uint32 pathNode ) bool WorldSession::SendLearnNewTaxiNode( Creature* unit ) { // 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 ) return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result. diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c802c75e8..cbeadd2b7 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7134" + #define REVISION_NR "7135" #endif // __REVISION_NR_H__