aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
index ff052ba..f3ec572 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
@@ -112,6 +112,9 @@ namespace OpenSim.Region.CoreModules.World.Sound
112 112
113 SceneObjectGroup grp = part.ParentGroup; 113 SceneObjectGroup grp = part.ParentGroup;
114 114
115 if (radius == 0)
116 radius = MaxDistance;
117
115 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp) 118 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
116 { 119 {
117 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); 120 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
@@ -130,9 +133,6 @@ namespace OpenSim.Region.CoreModules.World.Sound
130 float thisSpGain; 133 float thisSpGain;
131 134
132 // Scale by distance 135 // Scale by distance
133 if (radius == 0)
134 thisSpGain = (float)((double)gain * ((100.0 - dis) / 100.0));
135 else
136 thisSpGain = (float)((double)gain * ((radius - dis) / radius)); 136 thisSpGain = (float)((double)gain * ((radius - dis) / radius));
137 137
138 sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, thisSpGain, flags); 138 sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, thisSpGain, flags);
@@ -160,6 +160,9 @@ namespace OpenSim.Region.CoreModules.World.Sound
160 } 160 }
161 } 161 }
162 162
163 if (radius == 0)
164 radius = MaxDistance;
165
163 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp) 166 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
164 { 167 {
165 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); 168 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
@@ -170,9 +173,6 @@ namespace OpenSim.Region.CoreModules.World.Sound
170 float thisSpGain; 173 float thisSpGain;
171 174
172 // Scale by distance 175 // Scale by distance
173 if (radius == 0)
174 thisSpGain = (float)((double)gain * ((100.0 - dis) / 100.0));
175 else
176 thisSpGain = (float)((double)gain * ((radius - dis) / radius)); 176 thisSpGain = (float)((double)gain * ((radius - dis) / radius));
177 177
178 sp.ControllingClient.SendTriggeredSound( 178 sp.ControllingClient.SendTriggeredSound(