aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectAccessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/ObjectAccessor.cpp')
-rw-r--r--src/game/ObjectAccessor.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp
index 654645f3068..e5243ab941e 100644
--- a/src/game/ObjectAccessor.cpp
+++ b/src/game/ObjectAccessor.cpp
@@ -624,8 +624,12 @@ ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m)
for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
BuildPacket(iter->getSource());
- if (iter->getSource()->isPossessedByPlayer())
- BuildPacket((Player*)iter->getSource()->GetCharmer());
+ if (!iter->getSource()->GetSharedVisionList().empty())
+ {
+ SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
+ for ( ; it != iter->getSource()->GetSharedVisionList().end(); ++it)
+ BuildPacket(*it);
+ }
}
}
@@ -633,8 +637,28 @@ void
ObjectAccessor::WorldObjectChangeAccumulator::Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
- if (iter->getSource()->isPossessedByPlayer())
- BuildPacket((Player*)iter->getSource()->GetCharmer());
+ {
+ if (!iter->getSource()->GetSharedVisionList().empty())
+ {
+ SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
+ for ( ; it != iter->getSource()->GetSharedVisionList().end(); ++it)
+ BuildPacket(*it);
+ }
+ }
+}
+
+void
+ObjectAccessor::WorldObjectChangeAccumulator::Visit(DynamicObjectMapType &m)
+{
+ for(DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
+ {
+ if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID()))
+ {
+ Player* caster = (Player*)iter->getSource()->GetCaster();
+ if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID())
+ BuildPacket(caster);
+ }
+ }
}
void