(cherry picked from commit 9299e9bde0)
This commit is contained in:
Shauren
2017-05-13 19:37:33 +02:00
committed by ariel-
parent 7874bee7bf
commit d6201e5dbb
57 changed files with 236 additions and 404 deletions

View File

@@ -2493,7 +2493,7 @@ void SmartScript::GetWorldObjectsInDist(ObjectVector& targets, float dist) const
Trinity::AllWorldObjectsInRange u_check(obj, dist);
Trinity::WorldObjectListSearcher<Trinity::AllWorldObjectsInRange> searcher(obj, targets, u_check);
obj->VisitNearbyObject(dist, searcher);
Cell::VisitAllObjects(obj, searcher, dist);
}
void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
@@ -3356,10 +3356,9 @@ Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) const
return nullptr;
Unit* unit = nullptr;
Trinity::MostHPMissingInRange u_check(me, range, MinHPDiff);
Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitGridObjects(me, searcher, range);
return unit;
}
@@ -3370,7 +3369,7 @@ void SmartScript::DoFindFriendlyCC(std::vector<Creature*>& creatures, float rang
Trinity::FriendlyCCedInRange u_check(me, range);
Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, creatures, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitGridObjects(me, searcher, range);
}
void SmartScript::DoFindFriendlyMissingBuff(std::vector<Creature*>& creatures, float range, uint32 spellid) const
@@ -3380,7 +3379,7 @@ void SmartScript::DoFindFriendlyMissingBuff(std::vector<Creature*>& creatures, f
Trinity::FriendlyMissingBuffInRange u_check(me, range, spellid);
Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, creatures, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitGridObjects(me, searcher, range);
}
Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly) const
@@ -3391,7 +3390,7 @@ Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly) co
Unit* unit = nullptr;
Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
Trinity::UnitLastSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitAllObjects(me, searcher, range);
return unit;
}