aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Grids/Notifiers
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Grids/Notifiers')
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.cpp1
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h14
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiersImpl.h50
3 files changed, 65 insertions, 0 deletions
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
index 287976bf774..b68d366dbfb 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
@@ -303,4 +303,5 @@ template void ObjectUpdater::Visit<Creature>(CreatureMapType&);
template void ObjectUpdater::Visit<GameObject>(GameObjectMapType&);
template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType&);
template void ObjectUpdater::Visit<AreaTrigger>(AreaTriggerMapType &);
+template void ObjectUpdater::Visit<SceneObject>(SceneObjectMapType &);
template void ObjectUpdater::Visit<Conversation>(ConversationMapType &);
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 09ee2936b0d..a0c31f76348 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -26,6 +26,7 @@
#include "GameObject.h"
#include "Packet.h"
#include "Player.h"
+#include "SceneObject.h"
#include "Spell.h"
#include "SpellInfo.h"
#include "TemporarySummon.h"
@@ -115,6 +116,7 @@ namespace Trinity
void Visit(DynamicObjectMapType &m) { updateObjects<DynamicObject>(m); }
void Visit(CorpseMapType &m) { updateObjects<Corpse>(m); }
void Visit(AreaTriggerMapType &m) { updateObjects<AreaTrigger>(m); }
+ void Visit(SceneObjectMapType &m) { updateObjects<SceneObject>(m); }
void Visit(ConversationMapType &m) { updateObjects<Conversation>(m); }
};
@@ -259,6 +261,7 @@ namespace Trinity
void Visit(CorpseMapType &m);
void Visit(DynamicObjectMapType &m);
void Visit(AreaTriggerMapType &m);
+ void Visit(SceneObjectMapType &m);
void Visit(ConversationMapType &m);
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
@@ -281,6 +284,7 @@ namespace Trinity
void Visit(CorpseMapType &m);
void Visit(DynamicObjectMapType &m);
void Visit(AreaTriggerMapType &m);
+ void Visit(SceneObjectMapType &m);
void Visit(ConversationMapType &m);
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
@@ -304,6 +308,7 @@ namespace Trinity
void Visit(GameObjectMapType &m);
void Visit(DynamicObjectMapType &m);
void Visit(AreaTriggerMapType &m);
+ void Visit(SceneObjectMapType &m);
void Visit(ConversationMapType &m);
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
@@ -372,6 +377,15 @@ namespace Trinity
i_do(itr->GetSource());
}
+ void Visit(SceneObjectMapType& m)
+ {
+ if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_SCENEOBJECT))
+ return;
+ for (SceneObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->GetSource()->IsInPhase(_searcher))
+ i_do(itr->GetSource());
+ }
+
void Visit(ConversationMapType &m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CONVERSATION))
diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
index 63daf6b6482..f09de34e4c9 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
@@ -322,6 +322,29 @@ void Trinity::WorldObjectSearcher<Check>::Visit(AreaTriggerMapType &m)
}
template<class Check>
+void Trinity::WorldObjectSearcher<Check>::Visit(SceneObjectMapType &m)
+{
+ if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_SCENEOBJECT))
+ return;
+
+ // already found
+ if (i_object)
+ return;
+
+ for (SceneObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ {
+ if (!itr->GetSource()->IsInPhase(_searcher))
+ continue;
+
+ if (i_check(itr->GetSource()))
+ {
+ i_object = itr->GetSource();
+ return;
+ }
+ }
+}
+
+template<class Check>
void Trinity::WorldObjectSearcher<Check>::Visit(ConversationMapType &m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CONVERSATION))
@@ -441,6 +464,22 @@ void Trinity::WorldObjectLastSearcher<Check>::Visit(AreaTriggerMapType &m)
}
template<class Check>
+void Trinity::WorldObjectLastSearcher<Check>::Visit(SceneObjectMapType &m)
+{
+ if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_SCENEOBJECT))
+ return;
+
+ for (SceneObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ {
+ if (!itr->GetSource()->IsInPhase(_searcher))
+ continue;
+
+ if (i_check(itr->GetSource()))
+ i_object = itr->GetSource();
+ }
+}
+
+template<class Check>
void Trinity::WorldObjectLastSearcher<Check>::Visit(ConversationMapType &m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CONVERSATION))
@@ -523,6 +562,17 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(AreaTriggerMapType &m)
}
template<class Check>
+void Trinity::WorldObjectListSearcher<Check>::Visit(SceneObjectMapType &m)
+{
+ if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_SCENEOBJECT))
+ return;
+
+ for (SceneObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (i_check(itr->GetSource()))
+ Insert(itr->GetSource());
+}
+
+template<class Check>
void Trinity::WorldObjectListSearcher<Check>::Visit(ConversationMapType &m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CONVERSATION))