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

integration
SignpostMarv 2012-10-05 14:13:38 +01:00 committed by Justin Clark-Casey (justincc)
parent 6bd1f0f209
commit 20be6a4b48
1 changed files with 4 additions and 8 deletions

View File

@ -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);
});
}