diff options
author | Melanie | 2010-10-28 13:24:45 +0100 |
---|---|---|
committer | Melanie | 2010-11-05 13:39:04 +0000 |
commit | e078c57bf09cc70f3026096002d3b6f279657ce7 (patch) | |
tree | ac837c883cfdf9f1bab8d147232d001ed2dcd94b /OpenSim | |
parent | Delete existing presences for a user ID when they log in again. (diff) | |
download | opensim-SC_OLD-e078c57bf09cc70f3026096002d3b6f279657ce7.zip opensim-SC_OLD-e078c57bf09cc70f3026096002d3b6f279657ce7.tar.gz opensim-SC_OLD-e078c57bf09cc70f3026096002d3b6f279657ce7.tar.bz2 opensim-SC_OLD-e078c57bf09cc70f3026096002d3b6f279657ce7.tar.xz |
Fix attached sounds from HUDs erroneously being delivered to other avatars
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | 19 |
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)); |