aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/CollisionSounds.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-07-09 00:14:30 +0100
committerUbitUmarov2017-07-09 00:14:30 +0100
commitcc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036 (patch)
tree67beed0666a796ae8b7a02bcb78e438a745e9fb7 /OpenSim/Region/Framework/Scenes/CollisionSounds.cs
parentbug fix: dynamic testures set to ALL_SIDES, preserve other face data already ... (diff)
downloadopensim-SC-cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036.zip
opensim-SC-cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036.tar.gz
opensim-SC-cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036.tar.bz2
opensim-SC-cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036.tar.xz
throttle collision sounds on a SOG.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/CollisionSounds.cs24
1 files changed, 18 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs
index e76fef4..f87043e 100644
--- a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs
+++ b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs
@@ -116,16 +116,20 @@ namespace OpenSim.Region.Framework.Scenes
116 116
117 public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist) 117 public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist)
118 { 118 {
119 if (part.CollisionSoundType < 0)
120 return;
121
119 if (collidersinfolist.Count == 0 || part == null) 122 if (collidersinfolist.Count == 0 || part == null)
120 return; 123 return;
121 124
122 if (part.VolumeDetectActive || (part.Flags & PrimFlags.Physics) == 0) 125 if (part.VolumeDetectActive || (part.Flags & PrimFlags.Physics) == 0)
123 return; 126 return;
124 127
125 if (part.ParentGroup == null) 128 SceneObjectGroup sog = part.ParentGroup;
129 if (sog == null || sog.IsDeleted || sog.inTransit)
126 return; 130 return;
127 131
128 if (part.CollisionSoundType < 0) 132 if(sog.CollisionSoundThrootled(part.CollisionSoundType))
129 return; 133 return;
130 134
131 float volume = part.CollisionSoundVolume; 135 float volume = part.CollisionSoundVolume;
@@ -189,15 +193,23 @@ namespace OpenSim.Region.Framework.Scenes
189 continue; 193 continue;
190 } 194 }
191 195
192 SceneObjectPart otherPart = part.ParentGroup.Scene.GetSceneObjectPart(id); 196 SceneObjectPart otherPart = sog.Scene.GetSceneObjectPart(id);
193 if (otherPart != null) 197 if (otherPart != null)
194 { 198 {
195 if (otherPart.CollisionSoundType < 0 || otherPart.VolumeDetectActive) 199 SceneObjectGroup othersog = otherPart.ParentGroup;
200 if(othersog == null || othersog.IsDeleted || othersog.inTransit)
201 continue;
202
203 int otherType = otherPart.CollisionSoundType;
204 if (otherType < 0 || otherPart.VolumeDetectActive)
196 continue; 205 continue;
197 206
198 if (!HaveSound) 207 if (!HaveSound)
199 { 208 {
200 if (otherPart.CollisionSoundType == 1) 209 if(othersog.CollisionSoundThrootled(otherType))
210 continue;
211
212 if (otherType == 1)
201 { 213 {
202 soundID = otherPart.CollisionSound; 214 soundID = otherPart.CollisionSound;
203 volume = otherPart.CollisionSoundVolume; 215 volume = otherPart.CollisionSoundVolume;
@@ -206,7 +218,7 @@ namespace OpenSim.Region.Framework.Scenes
206 } 218 }
207 else 219 else
208 { 220 {
209 if (otherPart.CollisionSoundType == 2) 221 if (otherType == 2)
210 { 222 {
211 volume = otherPart.CollisionSoundVolume; 223 volume = otherPart.CollisionSoundVolume;
212 if (volume == 0.0f) 224 if (volume == 0.0f)