[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

@ -5471,17 +5471,9 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
return true;
}
CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
MaNGOS::RespawnDo u_do;
MaNGOS::WorldObjectWorker<MaNGOS::RespawnDo> worker(pl,u_do);
TypeContainerVisitor<MaNGOS::WorldObjectWorker<MaNGOS::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
cell.Visit(p, obj_worker, *pl->GetMap());
Cell::VisitGridObjects(pl, worker, pl->GetMap()->GetVisibilityDistance());
return true;
}