mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7143] Avoid selection quest taxi nodes for taxi master map.
Preper at loading more stricted taxi nodes mask for normal taxi network with excliuded quest only nodes (used from spells with SPELL_EFFECT_SEND_TAXI. Use prepered mask at search nearest to taxi master taxi node.
This commit is contained in:
parent
6bdb95dfc3
commit
3afd542de2
3 changed files with 61 additions and 25 deletions
|
|
@ -4767,8 +4767,16 @@ uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, u
|
|||
for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
|
||||
{
|
||||
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
|
||||
if(node && node->map_id == mapid && node->MountCreatureID[team == ALLIANCE ? 1 : 0])
|
||||
{
|
||||
if(!node || node->map_id != mapid || !node->MountCreatureID[team == ALLIANCE ? 1 : 0])
|
||||
continue;
|
||||
|
||||
uint8 field = (uint8)((i - 1) / 32);
|
||||
uint32 submask = 1<<((i-1)%32);
|
||||
|
||||
// skip not taxi network nodes
|
||||
if((sTaxiNodesMask[field] & submask)==0)
|
||||
continue;
|
||||
|
||||
float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z);
|
||||
if(found)
|
||||
{
|
||||
|
|
@ -4785,7 +4793,6 @@ uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, u
|
|||
id = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -405,18 +405,6 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiNodesStore, dbcPath,"TaxiNodes.dbc");
|
||||
|
||||
// Initialize global taxinodes mask
|
||||
memset(sTaxiNodesMask,0,sizeof(sTaxiNodesMask));
|
||||
for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
|
||||
{
|
||||
if(sTaxiNodesStore.LookupEntry(i))
|
||||
{
|
||||
uint8 field = (uint8)((i - 1) / 32);
|
||||
uint32 submask = 1<<((i-1)%32);
|
||||
sTaxiNodesMask[field] |= submask;
|
||||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiPathStore, dbcPath,"TaxiPath.dbc");
|
||||
for(uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i)
|
||||
if(TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i))
|
||||
|
|
@ -444,6 +432,47 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
sTaxiPathNodesByPath[entry->path][entry->index] = TaxiPathNode(entry->mapid,entry->x,entry->y,entry->z,entry->actionFlag,entry->delay);
|
||||
sTaxiPathNodeStore.Clear();
|
||||
|
||||
// Initialize global taxinodes mask
|
||||
// include existed nodes that have at least single not spell base (scripted) path
|
||||
{
|
||||
std::set<uint32> spellPaths;
|
||||
for(uint32 i = 1; i < sSpellStore.GetNumRows (); ++i)
|
||||
if(SpellEntry const* sInfo = sSpellStore.LookupEntry (i))
|
||||
for(int j=0; j < 3; ++j)
|
||||
if(sInfo->Effect[j]==123 /*SPELL_EFFECT_SEND_TAXI*/)
|
||||
spellPaths.insert(sInfo->EffectMiscValue[j]);
|
||||
|
||||
memset(sTaxiNodesMask,0,sizeof(sTaxiNodesMask));
|
||||
for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
|
||||
{
|
||||
if(!sTaxiNodesStore.LookupEntry(i))
|
||||
continue;
|
||||
|
||||
TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(i);
|
||||
if(src_i!=sTaxiPathSetBySource.end() && !src_i->second.empty())
|
||||
{
|
||||
bool ok = false;
|
||||
for(TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin();dest_i != src_i->second.end(); ++dest_i)
|
||||
{
|
||||
// not spell path
|
||||
if(spellPaths.find(dest_i->second.ID)==spellPaths.end())
|
||||
{
|
||||
ok = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!ok)
|
||||
continue;
|
||||
}
|
||||
|
||||
// valid taxi netowrk node
|
||||
uint8 field = (uint8)((i - 1) / 32);
|
||||
uint32 submask = 1<<((i-1)%32);
|
||||
sTaxiNodesMask[field] |= submask;
|
||||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTotemCategoryStore, dbcPath,"TotemCategory.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleStore, dbcPath,"Vehicle.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7142"
|
||||
#define REVISION_NR "7143"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue