mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
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
This commit is contained in:
committed by
Justin Clark-Casey (justincc)
parent
6bd1f0f209
commit
20be6a4b48
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user