mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10513] Clear grid *Check/*Searcher clases use
* Check class considered have all info select object in world from suggested but grid walker list in some grid. This also meaning that Check must always have focus object around that (and in same phase) fit objects must be. * Searcher only must ask Check and know how from all objects fiting to Check select result object(s). For this reason and for better compatibility removed first arg (searcher) form all Searcher classes. Instead expected used Check::GetFocusObject() object if need ( by always need check and simolify Check classes phase checked in Search classes). This also restore source code compatibilty in related lines with prev.client version branches code. * While focus object adding fixed possible wrong phase object selection at stealth detection and at corpse searches.
This commit is contained in:
parent
5e9b5a5297
commit
b0edd807d7
13 changed files with 169 additions and 94 deletions
|
|
@ -2702,7 +2702,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
|
|||
if(!obj && sObjectMgr.GetGOData(lowguid)) // guid is DB guid of object
|
||||
{
|
||||
MaNGOS::GameObjectWithDbGUIDCheck go_check(*pl,lowguid);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(pl,obj,go_check);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(obj,go_check);
|
||||
Cell::VisitGridObjects(pl,checker, pl->GetMap()->GetVisibilityDistance());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -656,7 +656,7 @@ void Creature::DoFleeToGetAssistance()
|
|||
Creature* pCreature = NULL;
|
||||
|
||||
MaNGOS::NearestAssistCreatureInCreatureRangeCheck u_check(this, getVictim(), radius);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestAssistCreatureInCreatureRangeCheck> searcher(this, pCreature, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestAssistCreatureInCreatureRangeCheck> searcher(pCreature, u_check);
|
||||
Cell::VisitGridObjects(this, searcher, radius);
|
||||
|
||||
SetNoSearchAssistance(true);
|
||||
|
|
@ -1697,7 +1697,7 @@ void Creature::CallAssistance()
|
|||
|
||||
{
|
||||
MaNGOS::AnyAssistCreatureInRangeCheck u_check(this, getVictim(), radius);
|
||||
MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck> searcher(assistList, u_check);
|
||||
Cell::VisitGridObjects(this,searcher, radius);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1258,8 +1258,8 @@ Unit* CreatureEventAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
|
|||
{
|
||||
Unit* pUnit = NULL;
|
||||
|
||||
MaNGOS::MostHPMissingInRange u_check(m_creature, range, MinHPDiff);
|
||||
MaNGOS::UnitLastSearcher<MaNGOS::MostHPMissingInRange> searcher(m_creature, pUnit, u_check);
|
||||
MaNGOS::MostHPMissingInRangeCheck u_check(m_creature, range, MinHPDiff);
|
||||
MaNGOS::UnitLastSearcher<MaNGOS::MostHPMissingInRangeCheck> searcher(pUnit, u_check);
|
||||
|
||||
/*
|
||||
typedef TYPELIST_4(GameObject, Creature*except pets*, DynamicObject, Corpse*Bones*) AllGridObjectTypes;
|
||||
|
|
@ -1271,15 +1271,15 @@ Unit* CreatureEventAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
|
|||
|
||||
void CreatureEventAI::DoFindFriendlyCC(std::list<Creature*>& _list, float range)
|
||||
{
|
||||
MaNGOS::FriendlyCCedInRange u_check(m_creature, range);
|
||||
MaNGOS::CreatureListSearcher<MaNGOS::FriendlyCCedInRange> searcher(m_creature, _list, u_check);
|
||||
MaNGOS::FriendlyCCedInRangeCheck u_check(m_creature, range);
|
||||
MaNGOS::CreatureListSearcher<MaNGOS::FriendlyCCedInRangeCheck> searcher(_list, u_check);
|
||||
Cell::VisitGridObjects(m_creature, searcher, range);
|
||||
}
|
||||
|
||||
void CreatureEventAI::DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float range, uint32 spellid)
|
||||
{
|
||||
MaNGOS::FriendlyMissingBuffInRange u_check(m_creature, range, spellid);
|
||||
MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRange> searcher(m_creature, _list, u_check);
|
||||
MaNGOS::FriendlyMissingBuffInRangeCheck u_check(m_creature, range, spellid);
|
||||
MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRangeCheck> searcher(_list, u_check);
|
||||
Cell::VisitGridObjects(m_creature,searcher, range);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
if (owner && goInfo->trap.charges > 0) // hunter trap
|
||||
{
|
||||
MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, owner, radius);
|
||||
MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> checker(this,ok, u_check);
|
||||
MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> checker(ok, u_check);
|
||||
Cell::VisitGridObjects(this,checker, radius);
|
||||
if(!ok)
|
||||
Cell::VisitWorldObjects(this,checker, radius);
|
||||
|
|
@ -304,7 +304,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
// affect only players
|
||||
Player* p_ok = NULL;
|
||||
MaNGOS::AnyPlayerInObjectRangeCheck p_check(this, radius);
|
||||
MaNGOS::PlayerSearcher<MaNGOS::AnyPlayerInObjectRangeCheck> checker(this,p_ok, p_check);
|
||||
MaNGOS::PlayerSearcher<MaNGOS::AnyPlayerInObjectRangeCheck> checker(p_ok, p_check);
|
||||
Cell::VisitWorldObjects(this,checker, radius);
|
||||
ok = p_ok;
|
||||
}
|
||||
|
|
@ -792,7 +792,7 @@ void GameObject::TriggeringLinkedGameObject( uint32 trapEntry, Unit* target)
|
|||
{
|
||||
// using original GO distance
|
||||
MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range);
|
||||
MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO,go_check);
|
||||
MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(trapGO,go_check);
|
||||
|
||||
Cell::VisitGridObjects(this, checker, range);
|
||||
}
|
||||
|
|
@ -807,8 +807,8 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
|||
{
|
||||
GameObject* ok = NULL;
|
||||
|
||||
MaNGOS::NearestGameObjectFishingHole u_check(*this, range);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
MaNGOS::NearestGameObjectFishingHoleCheck u_check(*this, range);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::NearestGameObjectFishingHoleCheck> checker(ok, u_check);
|
||||
Cell::VisitGridObjects(this,checker, range);
|
||||
|
||||
return ok;
|
||||
|
|
|
|||
|
|
@ -187,6 +187,36 @@ namespace MaNGOS
|
|||
|
||||
// SEARCHERS & LIST SEARCHERS & WORKERS
|
||||
|
||||
/* Model Searcher class:
|
||||
template<class Check>
|
||||
struct MANGOS_DLL_DECL SomeSearcher
|
||||
{
|
||||
ResultType& i_result;
|
||||
Check & i_check;
|
||||
|
||||
SomeSearcher(ResultType& result, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_result(result), i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType &m);
|
||||
{
|
||||
..some code fast return if result found
|
||||
|
||||
for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (!i_check(itr->getSource()))
|
||||
continue;
|
||||
|
||||
..some code for update result and possible stop search
|
||||
}
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
||||
};
|
||||
*/
|
||||
|
||||
// WorldObject searchers & workers
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -196,8 +226,8 @@ namespace MaNGOS
|
|||
WorldObject* &i_object;
|
||||
Check &i_check;
|
||||
|
||||
WorldObjectSearcher(WorldObject const* searcher, WorldObject* & result, Check& check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
WorldObjectSearcher(WorldObject* & result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
|
||||
void Visit(GameObjectMapType &m);
|
||||
void Visit(PlayerMapType &m);
|
||||
|
|
@ -215,8 +245,8 @@ namespace MaNGOS
|
|||
std::list<WorldObject*> &i_objects;
|
||||
Check& i_check;
|
||||
|
||||
WorldObjectListSearcher(WorldObject const* searcher, std::list<WorldObject*> &objects, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
WorldObjectListSearcher(std::list<WorldObject*> &objects, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
|
||||
void Visit(PlayerMapType &m);
|
||||
void Visit(CreatureMapType &m);
|
||||
|
|
@ -282,8 +312,8 @@ namespace MaNGOS
|
|||
GameObject* &i_object;
|
||||
Check &i_check;
|
||||
|
||||
GameObjectSearcher(WorldObject const* searcher, GameObject* & result, Check& check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
GameObjectSearcher(GameObject* & result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
|
||||
void Visit(GameObjectMapType &m);
|
||||
|
||||
|
|
@ -298,8 +328,8 @@ namespace MaNGOS
|
|||
GameObject* &i_object;
|
||||
Check& i_check;
|
||||
|
||||
GameObjectLastSearcher(WorldObject const* searcher, GameObject* & result, Check& check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
GameObjectLastSearcher(GameObject* & result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
|
||||
void Visit(GameObjectMapType &m);
|
||||
|
||||
|
|
@ -313,8 +343,8 @@ namespace MaNGOS
|
|||
std::list<GameObject*> &i_objects;
|
||||
Check& i_check;
|
||||
|
||||
GameObjectListSearcher(WorldObject const* searcher, std::list<GameObject*> &objects, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) {}
|
||||
GameObjectListSearcher(std::list<GameObject*> &objects, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects), i_check(check) {}
|
||||
|
||||
void Visit(GameObjectMapType &m);
|
||||
|
||||
|
|
@ -331,8 +361,8 @@ namespace MaNGOS
|
|||
Unit* &i_object;
|
||||
Check & i_check;
|
||||
|
||||
UnitSearcher(WorldObject const* searcher, Unit* & result, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
UnitSearcher(Unit* & result, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType &m);
|
||||
void Visit(PlayerMapType &m);
|
||||
|
|
@ -348,8 +378,8 @@ namespace MaNGOS
|
|||
Unit* &i_object;
|
||||
Check & i_check;
|
||||
|
||||
UnitLastSearcher(WorldObject const* searcher, Unit* & result, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
UnitLastSearcher(Unit* & result, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType &m);
|
||||
void Visit(PlayerMapType &m);
|
||||
|
|
@ -365,8 +395,8 @@ namespace MaNGOS
|
|||
std::list<Unit*> &i_objects;
|
||||
Check& i_check;
|
||||
|
||||
UnitListSearcher(WorldObject const* searcher, std::list<Unit*> &objects, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
UnitListSearcher(std::list<Unit*> &objects, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
|
||||
void Visit(PlayerMapType &m);
|
||||
void Visit(CreatureMapType &m);
|
||||
|
|
@ -383,8 +413,8 @@ namespace MaNGOS
|
|||
Creature* &i_object;
|
||||
Check & i_check;
|
||||
|
||||
CreatureSearcher(WorldObject const* searcher, Creature* & result, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
CreatureSearcher(Creature* & result, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType &m);
|
||||
|
||||
|
|
@ -399,8 +429,8 @@ namespace MaNGOS
|
|||
Creature* &i_object;
|
||||
Check & i_check;
|
||||
|
||||
CreatureLastSearcher(WorldObject const* searcher, Creature* & result, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
CreatureLastSearcher(Creature* & result, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType &m);
|
||||
|
||||
|
|
@ -414,8 +444,8 @@ namespace MaNGOS
|
|||
std::list<Creature*> &i_objects;
|
||||
Check& i_check;
|
||||
|
||||
CreatureListSearcher(WorldObject const* searcher, std::list<Creature*> &objects, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
CreatureListSearcher(std::list<Creature*> &objects, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType &m);
|
||||
|
||||
|
|
@ -450,8 +480,8 @@ namespace MaNGOS
|
|||
Player* &i_object;
|
||||
Check & i_check;
|
||||
|
||||
PlayerSearcher(WorldObject const* searcher, Player* & result, Check & check)
|
||||
: i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
PlayerSearcher(Player* & result, Check & check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
|
||||
void Visit(PlayerMapType &m);
|
||||
|
||||
|
|
@ -498,11 +528,29 @@ namespace MaNGOS
|
|||
|
||||
// CHECKS && DO classes
|
||||
|
||||
/* Model Check class:
|
||||
class SomeCheck
|
||||
{
|
||||
public:
|
||||
SomeCheck(SomeObjecType const* fobj, ..some other args) : i_fobj(fobj), ...other inits {}
|
||||
WorldObject const& GetFocusObject() const { return *i_fobj; }
|
||||
bool operator()(Creature* u) and for other intresting typs (Player/GameObject/Camera
|
||||
{
|
||||
return ..(code return true if Object fit to requirenment);
|
||||
}
|
||||
template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; }
|
||||
private:
|
||||
SomeObjecType const* i_fobj; // Focus object used for check distance from, phase, so place in world
|
||||
..other values need for check
|
||||
};
|
||||
*/
|
||||
|
||||
// WorldObject check classes
|
||||
class RaiseDeadObjectCheck
|
||||
{
|
||||
public:
|
||||
RaiseDeadObjectCheck(Player const* fobj, float range) : i_fobj(fobj), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_fobj; }
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if (i_fobj->isHonorOrXPTarget(u) ||
|
||||
|
|
@ -523,6 +571,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
ExplodeCorpseObjectCheck(WorldObject const* fobj, float range) : i_fobj(fobj), i_range(range) {}
|
||||
WorldObject const& GetFocisObject() const { return *i_fobj; }
|
||||
bool operator()(Player* u)
|
||||
{
|
||||
if (u->getDeathState()!=CORPSE || u->IsTaxiFlying() ||
|
||||
|
|
@ -550,6 +599,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
CannibalizeObjectCheck(WorldObject const* fobj, float range) : i_fobj(fobj), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_fobj; }
|
||||
bool operator()(Player* u)
|
||||
{
|
||||
if( i_fobj->IsFriendlyTo(u) || u->isAlive() || u->IsTaxiFlying() )
|
||||
|
|
@ -590,6 +640,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
GameObjectFocusCheck(Unit const* unit,uint32 focusId) : i_unit(unit), i_focusId(focusId) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_unit; }
|
||||
bool operator()(GameObject* go) const
|
||||
{
|
||||
if(go->GetGOInfo()->type != GAMEOBJECT_TYPE_SPELL_FOCUS)
|
||||
|
|
@ -608,10 +659,11 @@ namespace MaNGOS
|
|||
};
|
||||
|
||||
// Find the nearest Fishing hole and return true only if source object is in range of hole
|
||||
class NearestGameObjectFishingHole
|
||||
class NearestGameObjectFishingHoleCheck
|
||||
{
|
||||
public:
|
||||
NearestGameObjectFishingHole(WorldObject const& obj, float range) : i_obj(obj), i_range(range) {}
|
||||
NearestGameObjectFishingHoleCheck(WorldObject const& obj, float range) : i_obj(obj), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return i_obj; }
|
||||
bool operator()(GameObject* go)
|
||||
{
|
||||
if(go->GetGOInfo()->type == GAMEOBJECT_TYPE_FISHINGHOLE && go->isSpawned() && i_obj.IsWithinDistInMap(go, i_range) && i_obj.IsWithinDistInMap(go, (float)go->GetGOInfo()->fishinghole.radius))
|
||||
|
|
@ -627,7 +679,7 @@ namespace MaNGOS
|
|||
float i_range;
|
||||
|
||||
// prevent clone
|
||||
NearestGameObjectFishingHole(NearestGameObjectFishingHole const&);
|
||||
NearestGameObjectFishingHoleCheck(NearestGameObjectFishingHoleCheck const&);
|
||||
};
|
||||
|
||||
// Success at unit in range, range update for next check (this can be use with GameobjectLastSearcher to find nearest GO)
|
||||
|
|
@ -635,6 +687,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj,uint32 entry, float range) : i_obj(obj), i_entry(entry), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return i_obj; }
|
||||
bool operator()(GameObject* go)
|
||||
{
|
||||
if(go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range))
|
||||
|
|
@ -658,6 +711,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
GameObjectWithDbGUIDCheck(WorldObject const& obj,uint32 db_guid) : i_obj(obj), i_db_guid(db_guid) {}
|
||||
WorldObject const& GetFocusObject() const { return i_obj; }
|
||||
bool operator()(GameObject const* go) const
|
||||
{
|
||||
return go->GetDBTableGUIDLow() == i_db_guid;
|
||||
|
|
@ -669,10 +723,11 @@ namespace MaNGOS
|
|||
|
||||
// Unit checks
|
||||
|
||||
class MostHPMissingInRange
|
||||
class MostHPMissingInRangeCheck
|
||||
{
|
||||
public:
|
||||
MostHPMissingInRange(Unit const* obj, float range, uint32 hp) : i_obj(obj), i_range(range), i_hp(hp) {}
|
||||
MostHPMissingInRangeCheck(Unit const* obj, float range, uint32 hp) : i_obj(obj), i_range(range), i_hp(hp) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && u->GetMaxHealth() - u->GetHealth() > i_hp)
|
||||
|
|
@ -688,10 +743,11 @@ namespace MaNGOS
|
|||
uint32 i_hp;
|
||||
};
|
||||
|
||||
class FriendlyCCedInRange
|
||||
class FriendlyCCedInRangeCheck
|
||||
{
|
||||
public:
|
||||
FriendlyCCedInRange(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
|
||||
FriendlyCCedInRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
|
|
@ -706,10 +762,11 @@ namespace MaNGOS
|
|||
float i_range;
|
||||
};
|
||||
|
||||
class FriendlyMissingBuffInRange
|
||||
class FriendlyMissingBuffInRangeCheck
|
||||
{
|
||||
public:
|
||||
FriendlyMissingBuffInRange(WorldObject const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range), i_spell(spellid) {}
|
||||
FriendlyMissingBuffInRangeCheck(WorldObject const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range), i_spell(spellid) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
|
|
@ -729,6 +786,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
AnyUnfriendlyUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u))
|
||||
|
|
@ -747,7 +805,7 @@ namespace MaNGOS
|
|||
public:
|
||||
AnyUnfriendlyVisibleUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range)
|
||||
: i_obj(obj), i_funit(funit), i_range(range) {}
|
||||
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
return u->isAlive()
|
||||
|
|
@ -765,6 +823,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
AnyFriendlyUnitInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && i_obj->IsWithinDistInMap(u, i_range) && i_obj->IsFriendlyTo(u))
|
||||
|
|
@ -781,6 +840,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
AnyUnitInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && i_obj->IsWithinDistInMap(u, i_range))
|
||||
|
|
@ -798,6 +858,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
NearestAttackableUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if( u->isTargetableForAttack() && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
|
|
@ -827,6 +888,7 @@ namespace MaNGOS
|
|||
i_targetForUnit = i_originalCaster->isType(TYPEMASK_UNIT);
|
||||
i_targetForPlayer = (i_originalCaster->GetTypeId() == TYPEID_PLAYER);
|
||||
}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
// Check contains checks for: live, non-selectable, non-attackable flags, flight check and GM check, ignore totems
|
||||
|
|
@ -862,7 +924,7 @@ namespace MaNGOS
|
|||
{
|
||||
i_targetForPlayer = i_obj->IsControlledByPlayer();
|
||||
}
|
||||
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
// Check contains checks for: live, non-selectable, non-attackable flags, flight check and GM check, ignore totems
|
||||
|
|
@ -917,14 +979,24 @@ namespace MaNGOS
|
|||
float i_range;
|
||||
};
|
||||
|
||||
struct AnyDeadUnitCheck
|
||||
class AnyDeadUnitCheck
|
||||
{
|
||||
bool operator()(Unit* u) { return !u->isAlive(); }
|
||||
public:
|
||||
explicit AnyDeadUnitCheck(WorldObject const* fobj) : i_fobj(fobj) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_fobj; }
|
||||
bool operator()(Unit* u) { return !u->isAlive(); }
|
||||
private:
|
||||
WorldObject const* i_fobj;
|
||||
};
|
||||
|
||||
struct AnyStealthedCheck
|
||||
class AnyStealthedCheck
|
||||
{
|
||||
bool operator()(Unit* u) { return u->GetVisibility()==VISIBILITY_GROUP_STEALTH; }
|
||||
public:
|
||||
explicit AnyStealthedCheck(WorldObject const* fobj) : i_fobj(fobj) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_fobj; }
|
||||
bool operator()(Unit* u) { return u->GetVisibility()==VISIBILITY_GROUP_STEALTH; }
|
||||
private:
|
||||
WorldObject const* i_fobj;
|
||||
};
|
||||
|
||||
// Creature checks
|
||||
|
|
@ -933,6 +1005,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
explicit InAttackDistanceFromAnyHostileCreatureCheck(Unit* funit) : i_funit(funit) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_funit; }
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if(u->isAlive() && u->IsHostileTo(i_funit) && i_funit->IsWithinDistInMap(u, u->GetAttackDistance(i_funit)))
|
||||
|
|
@ -951,6 +1024,7 @@ namespace MaNGOS
|
|||
: i_funit(funit), i_enemy(enemy), i_range(range)
|
||||
{
|
||||
}
|
||||
WorldObject const& GetFocusObject() const { return *i_funit; }
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if(u == i_funit)
|
||||
|
|
@ -980,7 +1054,7 @@ namespace MaNGOS
|
|||
public:
|
||||
NearestAssistCreatureInCreatureRangeCheck(Creature* obj, Unit* enemy, float range)
|
||||
: i_obj(obj), i_enemy(enemy), i_range(range) {}
|
||||
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if(u == i_obj)
|
||||
|
|
@ -1013,7 +1087,7 @@ namespace MaNGOS
|
|||
public:
|
||||
NearestCreatureEntryWithLiveStateInObjectRangeCheck(WorldObject const& obj,uint32 entry, bool alive, float range)
|
||||
: i_obj(obj), i_entry(entry), i_alive(alive), i_range(range) {}
|
||||
|
||||
WorldObject const& GetFocusObject() const { return i_obj; }
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if(u->GetEntry() == i_entry && u->isAlive()==i_alive && i_obj.IsWithinDistInMap(u, i_range))
|
||||
|
|
@ -1036,18 +1110,19 @@ namespace MaNGOS
|
|||
|
||||
class AnyPlayerInObjectRangeCheck
|
||||
{
|
||||
public:
|
||||
AnyPlayerInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
|
||||
bool operator()(Player* u)
|
||||
{
|
||||
if(u->isAlive() && i_obj->IsWithinDistInMap(u, i_range))
|
||||
return true;
|
||||
public:
|
||||
AnyPlayerInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_obj; }
|
||||
bool operator()(Player* u)
|
||||
{
|
||||
if(u->isAlive() && i_obj->IsWithinDistInMap(u, i_range))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
WorldObject const* i_obj;
|
||||
float i_range;
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
WorldObject const* i_obj;
|
||||
float i_range;
|
||||
};
|
||||
|
||||
// Player checks and do
|
||||
|
|
|
|||
|
|
@ -2233,7 +2233,7 @@ void Map::ScriptsProcess()
|
|||
if (step.script->talk.creatureEntry)
|
||||
{
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSource, step.script->talk.creatureEntry, true, step.script->talk.searchRadius);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pSource, pBuddy, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pBuddy, u_check);
|
||||
|
||||
Cell::VisitGridObjects(pSource, searcher, step.script->talk.searchRadius);
|
||||
}
|
||||
|
|
@ -2522,7 +2522,7 @@ void Map::ScriptsProcess()
|
|||
int32 time_to_despawn = step.script->respawnGo.despawnDelay < 5 ? 5 : step.script->respawnGo.despawnDelay;
|
||||
|
||||
MaNGOS::GameObjectWithDbGUIDCheck go_check(*summoner, step.script->respawnGo.goGuid);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(summoner, go, go_check);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(go, go_check);
|
||||
Cell::VisitGridObjects(summoner, checker, GetVisibilityDistance());
|
||||
|
||||
if (!go)
|
||||
|
|
@ -2611,7 +2611,7 @@ void Map::ScriptsProcess()
|
|||
int32 time_to_close = step.script->openDoor.resetDelay < 15 ? 15 : step.script->openDoor.resetDelay;
|
||||
|
||||
MaNGOS::GameObjectWithDbGUIDCheck go_check(*caster, step.script->openDoor.goGuid);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(caster, door, go_check);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(door, go_check);
|
||||
Cell::VisitGridObjects(caster, checker, GetVisibilityDistance());
|
||||
|
||||
if (!door)
|
||||
|
|
@ -2662,7 +2662,7 @@ void Map::ScriptsProcess()
|
|||
int32 time_to_open = step.script->closeDoor.resetDelay < 15 ? 15 : step.script->closeDoor.resetDelay;
|
||||
|
||||
MaNGOS::GameObjectWithDbGUIDCheck go_check(*caster, step.script->closeDoor.goGuid);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(caster, door, go_check);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(door, go_check);
|
||||
Cell::VisitGridObjects(caster, checker, GetVisibilityDistance());
|
||||
|
||||
if (!door)
|
||||
|
|
@ -2922,7 +2922,7 @@ void Map::ScriptsProcess()
|
|||
else // If step has a buddy entry defined, search for it
|
||||
{
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSource, step.script->movement.creatureEntry, true, step.script->movement.searchRadius);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pSource, pMover, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pMover, u_check);
|
||||
|
||||
Cell::VisitGridObjects(pSource, searcher, step.script->movement.searchRadius);
|
||||
}
|
||||
|
|
@ -2983,7 +2983,7 @@ void Map::ScriptsProcess()
|
|||
else // If step has a buddy entry defined, search for it
|
||||
{
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSource, step.script->activeObject.creatureEntry, true, step.script->activeObject.searchRadius);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pSource, pOwner, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pOwner, u_check);
|
||||
|
||||
Cell::VisitGridObjects(pSource, searcher, step.script->activeObject.searchRadius);
|
||||
}
|
||||
|
|
@ -3029,7 +3029,7 @@ void Map::ScriptsProcess()
|
|||
else // If step has a buddy entry defined, search for it
|
||||
{
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSource, step.script->faction.creatureEntry, true, step.script->faction.searchRadius);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pSource, pOwner, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pOwner, u_check);
|
||||
|
||||
Cell::VisitGridObjects(pSource, searcher, step.script->faction.searchRadius);
|
||||
}
|
||||
|
|
@ -3079,7 +3079,7 @@ void Map::ScriptsProcess()
|
|||
else // If step has a buddy entry defined, search for it
|
||||
{
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSource, step.script->morph.creatureEntry, true, step.script->morph.searchRadius);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pSource, pOwner, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pOwner, u_check);
|
||||
|
||||
Cell::VisitGridObjects(pSource, searcher, step.script->morph.searchRadius);
|
||||
}
|
||||
|
|
@ -3136,7 +3136,7 @@ void Map::ScriptsProcess()
|
|||
else // If step has a buddy entry defined, search for it
|
||||
{
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSource, step.script->mount.creatureEntry, true, step.script->mount.searchRadius);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pSource, pOwner, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pOwner, u_check);
|
||||
|
||||
Cell::VisitGridObjects(pSource, searcher, step.script->mount.searchRadius);
|
||||
}
|
||||
|
|
@ -3193,7 +3193,7 @@ void Map::ScriptsProcess()
|
|||
else // If step has a buddy entry defined, search for it
|
||||
{
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSource, step.script->run.creatureEntry, true, step.script->run.searchRadius);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pSource, pOwner, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pOwner, u_check);
|
||||
|
||||
Cell::VisitGridObjects(pSource, searcher, step.script->run.searchRadius);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18155,8 +18155,8 @@ void Player::HandleStealthedUnitsDetection()
|
|||
{
|
||||
std::list<Unit*> stealthedUnits;
|
||||
|
||||
MaNGOS::AnyStealthedCheck u_check;
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck > searcher(this,stealthedUnits, u_check);
|
||||
MaNGOS::AnyStealthedCheck u_check(this);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck > searcher(stealthedUnits, u_check);
|
||||
Cell::VisitAllObjects(this, searcher, MAX_PLAYER_STEALTH_DETECT_RANGE);
|
||||
|
||||
WorldObject const* viewPoint = GetCamera().GetBody();
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ WorldObject* Spell::FindCorpseUsing()
|
|||
WorldObject* result = NULL;
|
||||
|
||||
T u_check(m_caster, max_range);
|
||||
MaNGOS::WorldObjectSearcher<T> searcher(m_caster, result, u_check);
|
||||
MaNGOS::WorldObjectSearcher<T> searcher(result, u_check);
|
||||
|
||||
Cell::VisitGridObjects(m_caster, searcher, max_range);
|
||||
|
||||
|
|
@ -1596,7 +1596,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
|
||||
{
|
||||
MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(m_caster, max_range);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(m_caster, tempTargetUnitMap, u_check);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
|
||||
Cell::VisitAllObjects(m_caster, searcher, max_range);
|
||||
}
|
||||
|
||||
|
|
@ -1656,7 +1656,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
std::list<Unit*> tempTargetUnitMap;
|
||||
{
|
||||
MaNGOS::AnyFriendlyUnitInObjectRangeCheck u_check(m_caster, max_range);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(m_caster, tempTargetUnitMap, u_check);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
|
||||
Cell::VisitAllObjects(m_caster, searcher, max_range);
|
||||
}
|
||||
|
||||
|
|
@ -1742,7 +1742,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
std::list<Unit *> tempTargetUnitMap;
|
||||
{
|
||||
MaNGOS::AnyAoEVisibleTargetUnitInObjectRangeCheck u_check(pUnitTarget, originalCaster, max_range);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyAoEVisibleTargetUnitInObjectRangeCheck> searcher(m_caster, tempTargetUnitMap, u_check);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyAoEVisibleTargetUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
|
||||
Cell::VisitAllObjects(m_caster, searcher, max_range);
|
||||
}
|
||||
if (tempTargetUnitMap.empty())
|
||||
|
|
@ -4572,7 +4572,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if (i_spellST->second.targetEntry)
|
||||
{
|
||||
MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*m_caster, i_spellST->second.targetEntry, range);
|
||||
MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(m_caster, p_GameObject, go_check);
|
||||
MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(p_GameObject, go_check);
|
||||
Cell::VisitGridObjects(m_caster, checker, range);
|
||||
|
||||
if (p_GameObject)
|
||||
|
|
@ -4625,7 +4625,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if (!targetExplicit)
|
||||
{
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, i_spellST->second.targetEntry, i_spellST->second.type != SPELL_TARGET_TYPE_DEAD, range);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, p_Creature, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(p_Creature, u_check);
|
||||
|
||||
// Visit all, need to find also Pet* objects
|
||||
Cell::VisitAllObjects(m_caster, searcher, range);
|
||||
|
|
@ -5818,7 +5818,7 @@ SpellCastResult Spell::CheckItems()
|
|||
{
|
||||
GameObject* ok = NULL;
|
||||
MaNGOS::GameObjectFocusCheck go_check(m_caster,m_spellInfo->RequiresSpellFocus);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectFocusCheck> checker(m_caster, ok, go_check);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectFocusCheck> checker(ok, go_check);
|
||||
Cell::VisitGridObjects(m_caster, checker, m_caster->GetMap()->GetVisibilityDistance());
|
||||
|
||||
if(!ok)
|
||||
|
|
|
|||
|
|
@ -697,14 +697,14 @@ void AreaAura::Update(uint32 diff)
|
|||
case AREA_AURA_FRIEND:
|
||||
{
|
||||
MaNGOS::AnyFriendlyUnitInObjectRangeCheck u_check(caster, m_radius);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(caster,targets, u_check);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
|
||||
Cell::VisitAllObjects(caster, searcher, m_radius);
|
||||
break;
|
||||
}
|
||||
case AREA_AURA_ENEMY:
|
||||
{
|
||||
MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(caster, m_radius); // No GetCharmer in searcher
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(caster, targets, u_check);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(targets, u_check);
|
||||
Cell::VisitAllObjects(caster, searcher, m_radius);
|
||||
break;
|
||||
}
|
||||
|
|
@ -7368,7 +7368,7 @@ void Aura::PeriodicDummyTick()
|
|||
float radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spell->rangeIndex));
|
||||
|
||||
MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck u_check(target, target, radius);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck> checker(target, targets, u_check);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck> checker(targets, u_check);
|
||||
Cell::VisitAllObjects(target, checker, radius);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1573,7 +1573,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
|
|||
float fRange = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
|
||||
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, 28523, true, fRange*2);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, pTargetDummy, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pTargetDummy, u_check);
|
||||
|
||||
Cell::VisitGridObjects(m_caster, searcher, fRange*2);
|
||||
|
||||
|
|
@ -5758,7 +5758,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
|
||||
// search for a reef cow nearby
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, 24797, true, range);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, pQuestCow, u_check);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pQuestCow, u_check);
|
||||
|
||||
Cell::VisitGridObjects(m_caster, searcher, range);
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/)
|
|||
victim = NULL;
|
||||
|
||||
MaNGOS::NearestAttackableUnitInObjectRangeCheck u_check(m_creature, m_creature, max_range);
|
||||
MaNGOS::UnitLastSearcher<MaNGOS::NearestAttackableUnitInObjectRangeCheck> checker(m_creature,victim, u_check);
|
||||
MaNGOS::UnitLastSearcher<MaNGOS::NearestAttackableUnitInObjectRangeCheck> checker(victim, u_check);
|
||||
Cell::VisitAllObjects(m_creature, checker, max_range);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10051,7 +10051,7 @@ Unit* Unit::SelectRandomUnfriendlyTarget(Unit* except /*= NULL*/, float radius /
|
|||
std::list<Unit *> targets;
|
||||
|
||||
MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, radius);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
|
||||
Cell::VisitAllObjects(this, searcher, radius);
|
||||
|
||||
// remove current target
|
||||
|
|
@ -10089,7 +10089,7 @@ Unit* Unit::SelectRandomFriendlyTarget(Unit* except /*= NULL*/, float radius /*=
|
|||
std::list<Unit *> targets;
|
||||
|
||||
MaNGOS::AnyFriendlyUnitInObjectRangeCheck u_check(this, radius);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
|
||||
|
||||
Cell::VisitAllObjects(this, searcher, radius);
|
||||
// remove current target
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10512"
|
||||
#define REVISION_NR "10513"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue