aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 }