aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2012-08-01 00:08:02 +0100
committerMelanie2012-08-01 00:08:02 +0100
commit8114260946be8bbe6754d497f104804d203e00e2 (patch)
treeb87ac81a06f7fffbb39d88e6bc24d4c615b05cee /OpenSim/Region/CoreModules
parentMerge branch 'avination' into careminster (diff)
parentResolve a deadlock between INPCModule and SensorRepeat by replacing the Senso... (diff)
downloadopensim-SC-8114260946be8bbe6754d497f104804d203e00e2.zip
opensim-SC-8114260946be8bbe6754d497f104804d203e00e2.tar.gz
opensim-SC-8114260946be8bbe6754d497f104804d203e00e2.tar.bz2
opensim-SC-8114260946be8bbe6754d497f104804d203e00e2.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index d768a1a..14c1a39 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -119,17 +119,20 @@ namespace OpenSim.Region.CoreModules.World.Sound
119 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp) 119 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
120 { 120 {
121 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); 121 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
122
122 if (dis > 100.0) // Max audio distance 123 if (dis > 100.0) // Max audio distance
123 return; 124 return;
124 125
126 float thisSpGain;
127
125 // Scale by distance 128 // Scale by distance
126 if (radius == 0) 129 if (radius == 0)
127 gain = (float)((double)gain * ((100.0 - dis) / 100.0)); 130 thisSpGain = (float)((double)gain * ((100.0 - dis) / 100.0));
128 else 131 else
129 gain = (float)((double)gain * ((radius - dis) / radius)); 132 thisSpGain = (float)((double)gain * ((radius - dis) / radius));
130 133
131 sp.ControllingClient.SendTriggeredSound( 134 sp.ControllingClient.SendTriggeredSound(
132 soundId, ownerID, objectID, parentID, handle, position, (float)gain); 135 soundId, ownerID, objectID, parentID, handle, position, thisSpGain);
133 }); 136 });
134 } 137 }
135 } 138 }