From e2d8faea093ab9aeeca1bbd8bba98fb06527a35b Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 20 Aug 2011 00:29:57 +0200 Subject: Core/Spells: move Cannibalize and Carrion Feeder cast checks to SpellScripts. --- src/server/game/Maps/Map.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/server/game/Maps') diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 6ff4bf05d42..f430002fca6 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -416,6 +416,7 @@ class Map : public GridRefManager template void SwitchGridContainers(T* obj, bool active); template void VisitAll(const float &x, const float &y, float radius, NOTIFIER ¬ifier); + template void VisitFirstFound(const float &x, const float &y, float radius, NOTIFIER ¬ifier); template void VisitWorld(const float &x, const float &y, float radius, NOTIFIER ¬ifier); template void VisitGrid(const float &x, const float &y, float radius, NOTIFIER ¬ifier); CreatureGroupHolderType CreatureGroupHolder; @@ -650,6 +651,25 @@ Map::VisitAll(const float &x, const float &y, float radius, NOTIFIER ¬ifier) cell.Visit(p, grid_object_notifier, *this, radius, x, y); } +// should be used with Searcher notifiers, tries to search world if nothing found in grid +template +inline void +Map::VisitFirstFound(const float &x, const float &y, float radius, NOTIFIER ¬ifier) +{ + CellPair p(Trinity::ComputeCellPair(x, y)); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + TypeContainerVisitor world_object_notifier(notifier); + cell.Visit(p, world_object_notifier, *this, radius, x, y); + if (!notifier.i_object) + { + TypeContainerVisitor grid_object_notifier(notifier); + cell.Visit(p, grid_object_notifier, *this, radius, x, y); + } +} + template inline void Map::VisitWorld(const float &x, const float &y, float radius, NOTIFIER ¬ifier) -- cgit v1.2.3