aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs22
1 files changed, 3 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index dededd4..1476f88 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2341,31 +2341,15 @@ namespace OpenSim.Region.Environment.Scenes
2341 client.OnDeactivateGesture += gesturesModule.DeactivateGesture; 2341 client.OnDeactivateGesture += gesturesModule.DeactivateGesture;
2342 } 2342 }
2343 2343
2344 //sound 2344 ISoundModule soundModule = RequestModuleInterface<ISoundModule>();
2345 client.OnSoundTrigger += SoundTrigger; 2345 if (soundModule != null)
2346 client.OnSoundTrigger += soundModule.TriggerSound;
2346 2347
2347 client.OnObjectOwner += ObjectOwner; 2348 client.OnObjectOwner += ObjectOwner;
2348 2349
2349 // EventManager.TriggerOnNewClient(client); 2350 // EventManager.TriggerOnNewClient(client);
2350 } 2351 }
2351 2352
2352 // Sound
2353 public virtual void SoundTrigger( UUID soundId, UUID ownerID, UUID objectID, UUID parentID,
2354 float gain, Vector3 position, UInt64 handle)
2355 {
2356 foreach (ScenePresence p in GetAvatars())
2357 {
2358 double dis = Util.GetDistanceTo(p.AbsolutePosition, position);
2359 if (dis > 100.0) // Max audio distance
2360 continue;
2361
2362 // Scale by distance
2363 gain = (float)((double)gain*((100.0 - dis) / 100.0));
2364 p.ControllingClient.SendTriggeredSound(soundId, ownerID, objectID, parentID, handle, position, (float)gain);
2365 }
2366
2367 }
2368
2369 /// <summary> 2353 /// <summary>
2370 /// Teleport an avatar to their home region 2354 /// Teleport an avatar to their home region
2371 /// </summary> 2355 /// </summary>