[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:
VladimirMangos 2010-09-22 05:13:45 +04:00
parent 5e9b5a5297
commit b0edd807d7
13 changed files with 169 additions and 94 deletions

View file

@ -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