From 20be6a4b48d73734e0041780868ff60078163004 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Fri, 5 Oct 2012 14:13:38 +0100 Subject: refactoring thisSpGain in PlayAttachedSound as it was previously using two typecasts in the assignment and had the assignment on a separate line to the declaration --- .../Region/CoreModules/World/Sound/SoundModuleNonShared.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs index f3ec572..14914b6 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs @@ -130,12 +130,10 @@ namespace OpenSim.Region.CoreModules.World.Sound dis = 0; } - float thisSpGain; - // Scale by distance - thisSpGain = (float)((double)gain * ((radius - dis) / radius)); + double thisSpGain = gain * ((radius - dis) / radius); - sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, thisSpGain, flags); + sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)thisSpGain, flags); }); } @@ -170,13 +168,11 @@ namespace OpenSim.Region.CoreModules.World.Sound if (dis > MaxDistance) // Max audio distance return; - float thisSpGain; - // Scale by distance - thisSpGain = (float)((double)gain * ((radius - dis) / radius)); + double thisSpGain = gain * ((radius - dis) / radius); sp.ControllingClient.SendTriggeredSound( - soundId, ownerID, objectID, parentID, handle, position, thisSpGain); + soundId, ownerID, objectID, parentID, handle, position, (float)thisSpGain); }); } -- cgit v1.1