fix loading mixer settings when the driver default value is calculated. Cannot use == to compare float with the loaded value in this case.

This commit is contained in:
Nicola Salmoria 2008-03-11 08:28:47 +00:00
parent 542b489706
commit bf88dd74e3

View File

@ -583,7 +583,7 @@ static void sound_load(int config_type, xml_data_node *parentnode)
{
float defvol = xml_get_attribute_float(channelnode, "defvol", -1000.0);
float newvol = xml_get_attribute_float(channelnode, "newvol", -1000.0);
if (defvol == sound_get_default_gain(mixernum) && newvol != -1000.0)
if (fabs(defvol - sound_get_default_gain(mixernum)) < 1e-6 && newvol != -1000.0)
sound_set_user_gain(mixernum, newvol);
}
}