aboutsummaryrefslogtreecommitdiff
path: root/src/game/Object.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-12 23:23:53 -0500
committermegamage <none@none>2009-08-12 23:23:53 -0500
commit729242058398f197d62585c334244fc9f817fd47 (patch)
tree8cac470fe4070c1c98a6334f32aa7f245c2417a2 /src/game/Object.cpp
parent92769d3ffeda9fbdd12760e453bc99320565ca98 (diff)
*Rewrite and simplify sendmessagetoset functions. This fixes the bug that player cannot see dummy aura is cancelled when puppet is far away.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r--src/game/Object.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 3b451bbbc51..edf7f949d26 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1680,18 +1680,14 @@ void Unit::BuildHeartBeatMsg(WorldPacket *data) const
void WorldObject::SendMessageToSet(WorldPacket *data, bool /*fake*/)
{
- //if object is in world, map for it already created!
- Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
- if(_map)
- _map->MessageBroadcast(this, data);
+ Trinity::MessageDistDeliverer notifier(this, data, World::GetMaxVisibleDistance());
+ VisitNearbyWorldObject(World::GetMaxVisibleDistance(), notifier);
}
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/)
{
- //if object is in world, map for it already created!
- Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
- if(_map)
- _map->MessageDistBroadcast(this, data, dist);
+ Trinity::MessageDistDeliverer notifier(this, data, dist);
+ VisitNearbyWorldObject(dist, notifier);
}
void WorldObject::SendObjectDeSpawnAnim(uint64 guid)