mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
7766d016ca
commit
d9d30fd40e
4 changed files with 7 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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<uint32>& mapIds );
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7134"
|
||||
#define REVISION_NR "7135"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue