aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2008-04-23 11:54:35 +0000
committerAdam Frisby2008-04-23 11:54:35 +0000
commit8425d53d689f61a97874f9f5fbfc3ca01ddf320e (patch)
tree61dda5e2415a893d46683c9bc6d60021f6053a06
parent* Applying Mantis #1021 (llStartAnimation/llStopAnimation) - Thanks Melanie! (diff)
downloadopensim-SC-8425d53d689f61a97874f9f5fbfc3ca01ddf320e.zip
opensim-SC-8425d53d689f61a97874f9f5fbfc3ca01ddf320e.tar.gz
opensim-SC-8425d53d689f61a97874f9f5fbfc3ca01ddf320e.tar.bz2
opensim-SC-8425d53d689f61a97874f9f5fbfc3ca01ddf320e.tar.xz
* Applying Mantis #1022 - Thanks Melanie!
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 48ca582..4c781c5 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -1996,7 +1996,7 @@ namespace OpenSim.Region.Environment.Scenes
1996 SceneObjectPart op = this; 1996 SceneObjectPart op = this;
1997 foreach (KeyValuePair<LLUUID, TaskInventoryItem> item in op.TaskInventory) 1997 foreach (KeyValuePair<LLUUID, TaskInventoryItem> item in op.TaskInventory)
1998 { 1998 {
1999 if (item.Value.Name == sound) 1999 if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
2000 { 2000 {
2001 soundID = item.Value.ItemID; 2001 soundID = item.Value.ItemID;
2002 break; 2002 break;
@@ -2004,10 +2004,19 @@ namespace OpenSim.Region.Environment.Scenes
2004 } 2004 }
2005 } 2005 }
2006 2006
2007 if(soundID == LLUUID.Zero)
2008 return;
2009
2007 List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); 2010 List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
2008 foreach (ScenePresence p in avatarts) 2011 foreach (ScenePresence p in avatarts)
2009 { 2012 {
2010 // TODO: some filtering by distance of avatar 2013 double dis=Util.GetDistanceTo(p.AbsolutePosition, position);
2014 if(dis > 100.0) // Max audio distance
2015 continue;
2016
2017 // Scale by distance
2018 volume*=((100.0-dis)/100.0);
2019
2011 if (triggered) 2020 if (triggered)
2012 { 2021 {
2013 p.ControllingClient.SendTriggeredSound(soundID, ownerID, objectID, parentID, regionHandle, position, (float)volume); 2022 p.ControllingClient.SendTriggeredSound(soundID, ownerID, objectID, parentID, regionHandle, position, (float)volume);