[9736] Added more usable interface for grid visits

(based on SilverIce's repo commit f20f01e)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
SilverIce 2010-04-12 14:53:21 +04:00 committed by VladimirMangos
parent 9a0de445b8
commit e3f3f3410a
19 changed files with 88 additions and 406 deletions

View file

@ -1975,16 +1975,9 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
if(!obj && sObjectMgr.GetGOData(lowguid)) // guid is DB guid of object
{
// search near player then
CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
MaNGOS::GameObjectWithDbGUIDCheck go_check(*pl,lowguid);
MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(pl,obj,go_check);
TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
cell.Visit(p, object_checker, *pl->GetMap());
Cell::VisitGridObjects(pl,checker, pl->GetMap()->GetVisibilityDistance());
}
return obj;