Core/Maps: Removed dbguid/spawnid grid searchers, they are no longer neccessary

This commit is contained in:
Shauren
2015-06-08 17:48:21 +02:00
parent ac53442e4f
commit cb854a2b7b
4 changed files with 29 additions and 81 deletions

View File

@@ -796,15 +796,11 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(ObjectGuid::Lo
if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object
{
// search near player then
CellCoord p(Trinity::ComputeCellCoord(pl->GetPositionX(), pl->GetPositionY()));
Cell cell(p);
auto bounds = pl->GetMap()->GetGameObjectBySpawnIdStore().equal_range(lowguid);
if (bounds.first == bounds.second)
return nullptr;
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(), *pl, pl->GetGridActivationRange());
return bounds.first->second;
}
return obj;