mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 01:37:05 +00:00
Phase system development continue.
* Use WorldObject phase mask field instead explicit aura scan. This allow have phase for any world objects. * Add phase checks to packet broadcasters/object searchers. This let correctly work say/yell/area and multi/random target spells/aggro assistance in phased areas or target selection. * In GM-mode character presense (see and visible) in all phases except normal visibility efects including GM-visibility. TODO: summoned objects phase set base at owner phase, load phase mask for creatures/gameobjects from DB, in game commands.
This commit is contained in:
parent
0c43a425e8
commit
b5da610388
16 changed files with 223 additions and 121 deletions
|
|
@ -153,7 +153,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
|
|||
if( target->GetTypeId()==TYPEID_PLAYER && target != i_check && (((Player*)target)->isGameMaster() || ((Player*)target)->GetVisibility()==VISIBILITY_OFF) )
|
||||
return;
|
||||
|
||||
if( i_check->GetTypeId()==TYPEID_PLAYER )
|
||||
if (i_check->GetTypeId()==TYPEID_PLAYER )
|
||||
{
|
||||
if (i_check->IsFriendlyTo( target ))
|
||||
return;
|
||||
|
|
@ -207,7 +207,10 @@ void MaNGOS::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
|||
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(i_check(itr->getSource()))
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
return;
|
||||
|
|
@ -224,6 +227,9 @@ void MaNGOS::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
|
|||
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
@ -241,6 +247,9 @@ void MaNGOS::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
|
|||
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
@ -258,6 +267,9 @@ void MaNGOS::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
|
|||
|
||||
for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
@ -275,6 +287,9 @@ void MaNGOS::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
|
|||
|
||||
for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
@ -287,40 +302,45 @@ template<class Check>
|
|||
void MaNGOS::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void MaNGOS::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void MaNGOS::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m)
|
||||
{
|
||||
for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void MaNGOS::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
{
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void MaNGOS::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
// Gameobject searchers
|
||||
|
|
@ -334,6 +354,9 @@ void MaNGOS::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
|||
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
@ -347,6 +370,9 @@ void MaNGOS::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
|||
{
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
}
|
||||
|
|
@ -356,8 +382,9 @@ template<class Check>
|
|||
void MaNGOS::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
{
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
// Unit searchers
|
||||
|
|
@ -371,6 +398,9 @@ void MaNGOS::UnitSearcher<Check>::Visit(CreatureMapType &m)
|
|||
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
@ -388,6 +418,9 @@ void MaNGOS::UnitSearcher<Check>::Visit(PlayerMapType &m)
|
|||
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
@ -401,6 +434,9 @@ void MaNGOS::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
|
|||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
}
|
||||
|
|
@ -411,6 +447,9 @@ void MaNGOS::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
|
|||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
}
|
||||
|
|
@ -420,16 +459,18 @@ template<class Check>
|
|||
void MaNGOS::UnitListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void MaNGOS::UnitListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
// Creature searchers
|
||||
|
|
@ -443,6 +484,9 @@ void MaNGOS::CreatureSearcher<Check>::Visit(CreatureMapType &m)
|
|||
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
@ -456,6 +500,9 @@ void MaNGOS::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
|
|||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
}
|
||||
|
|
@ -465,8 +512,9 @@ template<class Check>
|
|||
void MaNGOS::CreatureListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if( i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -478,6 +526,9 @@ void MaNGOS::PlayerSearcher<Check>::Visit(PlayerMapType &m)
|
|||
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if(i_check(itr->getSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue