aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index a52fea4..e77062b 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -62,6 +62,12 @@ namespace OpenSim.Region.CoreModules.World.Sound
62 public virtual void PlayAttachedSound( 62 public virtual void PlayAttachedSound(
63 UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius) 63 UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius)
64 { 64 {
65 SceneObjectPart part = m_scene.GetSceneObjectPart(objectID);
66 if (part == null)
67 return;
68
69 SceneObjectGroup grp = part.ParentGroup;
70
65 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 71 m_scene.ForEachScenePresence(delegate(ScenePresence sp)
66 { 72 {
67 if (sp.IsChildAgent) 73 if (sp.IsChildAgent)
@@ -71,6 +77,19 @@ namespace OpenSim.Region.CoreModules.World.Sound
71 if (dis > 100.0) // Max audio distance 77 if (dis > 100.0) // Max audio distance
72 return; 78 return;
73 79
80 if (grp.IsAttachment)
81 {
82
83 if (grp.GetAttachmentPoint() > 30) // HUD
84 {
85 if (sp.ControllingClient.AgentId != grp.OwnerID)
86 return;
87 }
88
89 if (sp.ControllingClient.AgentId == grp.OwnerID)
90 dis = 0;
91 }
92
74 // Scale by distance 93 // Scale by distance
75 if (radius == 0) 94 if (radius == 0)
76 gain = (float)((double)gain * ((100.0 - dis) / 100.0)); 95 gain = (float)((double)gain * ((100.0 - dis) / 100.0));