aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-23 17:54:13 +0000
committerJustin Clarke Casey2008-12-23 17:54:13 +0000
commitcce1b096dbd8aba46c405b7654d67d3ba96de33a (patch)
treeae8208af8343d8d82df1343038855e1d3c91eba0 /OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
parent* Add a method to allow friendship offers to a logged in client from an offli... (diff)
downloadopensim-SC-cce1b096dbd8aba46c405b7654d67d3ba96de33a.zip
opensim-SC-cce1b096dbd8aba46c405b7654d67d3ba96de33a.tar.gz
opensim-SC-cce1b096dbd8aba46c405b7654d67d3ba96de33a.tar.bz2
opensim-SC-cce1b096dbd8aba46c405b7654d67d3ba96de33a.tar.xz
* refactor: Replace part of SceneObjectPart with the identical sound playing code in the SoundModule
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs20
1 files changed, 5 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index ddfb413..6795c0a 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -37,6 +37,7 @@ using log4net;
37using OpenMetaverse; 37using OpenMetaverse;
38using OpenMetaverse.Packets; 38using OpenMetaverse.Packets;
39using OpenSim.Framework; 39using OpenSim.Framework;
40using OpenSim.Region.Environment.Interfaces;
40using OpenSim.Region.Environment.Scenes.Scripting; 41using OpenSim.Region.Environment.Scenes.Scripting;
41using OpenSim.Region.Physics.Manager; 42using OpenSim.Region.Physics.Manager;
42 43
@@ -2362,24 +2363,13 @@ if (m_shape != null) {
2362 if (soundID == UUID.Zero) 2363 if (soundID == UUID.Zero)
2363 return; 2364 return;
2364 2365
2365 List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); 2366 ISoundModule soundModule = m_parentGroup.Scene.RequestModuleInterface<ISoundModule>();
2366 foreach (ScenePresence p in avatarts) 2367 if (soundModule != null)
2367 { 2368 {
2368 double dis=Util.GetDistanceTo(p.AbsolutePosition, position);
2369 if (dis > 100.0) // Max audio distance
2370 continue;
2371
2372 // Scale by distance
2373 volume*=((100.0-dis)/100.0);
2374
2375 if (triggered) 2369 if (triggered)
2376 { 2370 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle);
2377 p.ControllingClient.SendTriggeredSound(soundID, ownerID, objectID, parentID, regionHandle, position, (float)volume);
2378 }
2379 else 2371 else
2380 { 2372 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags);
2381 p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)volume, flags);
2382 }
2383 } 2373 }
2384 } 2374 }
2385 2375