Core/Grid:

- Simplified CellArea calculation (Original author: SilverIce)

- Removed unused code in Cell class (Original author: SilverIce)

- Improve some Visit functions.
This commit is contained in:
kaelima
2011-10-19 17:40:44 +01:00
parent d7e0190726
commit be0b2fcf97
25 changed files with 127 additions and 353 deletions

View File

@@ -1224,7 +1224,7 @@ GameObject* ChatHandler::GetNearbyGameObject()
GameObject* obj = NULL;
Trinity::NearestGameObjectCheck check(*pl);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectCheck> searcher(pl, obj, check);
pl->VisitNearbyGridObject(999, searcher);
pl->VisitNearbyGridObject(SIZE_OF_GRIDS, searcher);
return obj;
}
@@ -1242,13 +1242,12 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
// search near player then
CellCoord p(Trinity::ComputeCellCoord(pl->GetPositionX(), pl->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
Trinity::GameObjectWithDbGUIDCheck go_check(*pl, lowguid);
Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl, obj, go_check);
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
cell.Visit(p, object_checker, *pl->GetMap());
cell.Visit(p, object_checker, *pl->GetMap(), *pl, pl->GetGridActivationRange());
}
return obj;