diff options
author | Justin Clark-Casey (justincc) | 2012-08-21 22:21:35 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-08-21 22:21:35 +0100 |
commit | 9925317239b9b7cfe90d682aaf4657cb70ff3b7d (patch) | |
tree | afb3a7f6356db5372dd34a486dcc4a5c000f3b9a /OpenSim | |
parent | refactoring out SetFaceColor (diff) | |
download | opensim-SC-9925317239b9b7cfe90d682aaf4657cb70ff3b7d.zip opensim-SC-9925317239b9b7cfe90d682aaf4657cb70ff3b7d.tar.gz opensim-SC-9925317239b9b7cfe90d682aaf4657cb70ff3b7d.tar.bz2 opensim-SC-9925317239b9b7cfe90d682aaf4657cb70ff3b7d.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 'OpenSim')
-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 | ||