diff options
author | Melanie | 2012-08-01 00:08:02 +0100 |
---|---|---|
committer | Melanie | 2012-08-01 00:08:02 +0100 |
commit | 8114260946be8bbe6754d497f104804d203e00e2 (patch) | |
tree | b87ac81a06f7fffbb39d88e6bc24d4c615b05cee /OpenSim/Region/CoreModules | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | Resolve a deadlock between INPCModule and SensorRepeat by replacing the Senso... (diff) | |
download | opensim-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.cs | 9 |
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 | } |