mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 11:21:58 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user