aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorSignpostMarv2012-10-05 14:13:38 +0100
committerJustin Clark-Casey (justincc)2012-10-29 23:38:57 +0000
commit20be6a4b48d73734e0041780868ff60078163004 (patch)
treed54eda69b0b2b9ae8e974b5eeb8ace7b1c9239ca /OpenSim
parentFactoring out an if-else block in PlayAttachedSound as it was using the previ... (diff)
downloadopensim-SC_OLD-20be6a4b48d73734e0041780868ff60078163004.zip
opensim-SC_OLD-20be6a4b48d73734e0041780868ff60078163004.tar.gz
opensim-SC_OLD-20be6a4b48d73734e0041780868ff60078163004.tar.bz2
opensim-SC_OLD-20be6a4b48d73734e0041780868ff60078163004.tar.xz
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
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs12
1 files changed, 4 insertions, 8 deletions
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
130 dis = 0; 130 dis = 0;
131 } 131 }
132 132
133 float thisSpGain;
134
135 // Scale by distance 133 // Scale by distance
136 thisSpGain = (float)((double)gain * ((radius - dis) / radius)); 134 double thisSpGain = gain * ((radius - dis) / radius);
137 135
138 sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, thisSpGain, flags); 136 sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)thisSpGain, flags);
139 }); 137 });
140 } 138 }
141 139
@@ -170,13 +168,11 @@ namespace OpenSim.Region.CoreModules.World.Sound
170 if (dis > MaxDistance) // Max audio distance 168 if (dis > MaxDistance) // Max audio distance
171 return; 169 return;
172 170
173 float thisSpGain;
174
175 // Scale by distance 171 // Scale by distance
176 thisSpGain = (float)((double)gain * ((radius - dis) / radius)); 172 double thisSpGain = gain * ((radius - dis) / radius);
177 173
178 sp.ControllingClient.SendTriggeredSound( 174 sp.ControllingClient.SendTriggeredSound(
179 soundId, ownerID, objectID, parentID, handle, position, thisSpGain); 175 soundId, ownerID, objectID, parentID, handle, position, (float)thisSpGain);
180 }); 176 });
181 } 177 }
182 178