diff options
author | Justin Clark-Casey (justincc) | 2012-08-21 22:21:35 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-08-24 21:52:51 +0100 |
commit | 1a7e3cabc0b2c194db25e2539eaccfb494428d24 (patch) | |
tree | 68d6a7e48469531e69ca0d03f81cd53b0ed03586 /OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | |
parent | Tighten up OpenSim.Framework.Cache locking to avoid race conditions. (diff) | |
download | opensim-SC_OLD-1a7e3cabc0b2c194db25e2539eaccfb494428d24.zip opensim-SC_OLD-1a7e3cabc0b2c194db25e2539eaccfb494428d24.tar.gz opensim-SC_OLD-1a7e3cabc0b2c194db25e2539eaccfb494428d24.tar.bz2 opensim-SC_OLD-1a7e3cabc0b2c194db25e2539eaccfb494428d24.tar.xz |
Fix bug in SoundModule.PlayAttachedSound() where every sound update to an avatar would base its gain calculation on the previous avatar's gain, instead of the original input gain
This is similar to commit d89faa which fixed the same kind of bug in TriggerSound()
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 14c1a39..a2f0950 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | |||
@@ -85,13 +85,15 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
85 | dis = 0; | 85 | dis = 0; |
86 | } | 86 | } |
87 | 87 | ||
88 | float thisSpGain; | ||
89 | |||
88 | // Scale by distance | 90 | // Scale by distance |
89 | if (radius == 0) | 91 | if (radius == 0) |
90 | gain = (float)((double)gain * ((100.0 - dis) / 100.0)); | 92 | thisSpGain = (float)((double)gain * ((100.0 - dis) / 100.0)); |
91 | else | 93 | else |
92 | gain = (float)((double)gain * ((radius - dis) / radius)); | 94 | thisSpGain = (float)((double)gain * ((radius - dis) / radius)); |
93 | 95 | ||
94 | sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); | 96 | sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, thisSpGain, flags); |
95 | }); | 97 | }); |
96 | } | 98 | } |
97 | 99 | ||