for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++)
{
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
{
CellPair cell_pair(x,y);
Cell r_zone(cell_pair);
r_zone.data.Part.nocreate = data.Part.nocreate;
m.Visit(r_zone, visitor);
}
}
}
diff --git a/src/game/Map.h b/src/game/Map.h
index 6e68529..0ff3799 100644
--- a/src/game/Map.h
+++ b/src/game/Map.h
@@ -406,6 +406,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
void RemoveFromActive(T* obj) { RemoveFromActiveHelper(obj); }
void RemoveFromActive(Creature* obj);
+
+ template<class NOTIFIER> void VisitGrid(const float &x, const float &y, float radius, NOTIFIER ¬ifier);
Creature* GetCreature(uint64 guid);
Vehicle* GetVehicle(uint64 guid);
@@ -629,4 +631,17 @@ Map::Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER> &visitor)
getNGrid(x, y)->Visit(cell_x, cell_y, visitor);
}
}
-#endif
+
+template<class NOTIFIER>
+inline void
+Map::VisitGrid(const float &x, const float &y, float radius, NOTIFIER ¬ifier)
+{
+ CellPair p(MaNGOS::ComputeCellPair(x, y));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ TypeContainerVisitor<NOTIFIER, GridTypeMapContainer > grid_object_notifier(notifier);
+ cell.Visit(p, grid_object_notifier, *this, radius, x, y);
+}
+#endif
\\ No newline at end of file
http://pastebin.com/m79340633
In line
MaNGOS:: GameObjectInRangeCheck check (x, y, z, radius + 15);
Instead of value 15 I recommend to use 15-20, the most optimum variant!
-------------------------------------------------------------------------------------------------------
В строке
MaNGOS::GameObjectInRangeCheck check(x, y, z, radius + 15);
вместо значения 15 рекомендую использовать 15-20, самый оптимальный вариант!