Make hearing component compatible with glasses

This commit is contained in:
commy2 2016-07-26 16:14:16 +02:00 committed by GitHub
parent fa7d0df2df
commit 755f6bcc6b

View File

@ -29,8 +29,16 @@ GVAR(volumeAttenuation) = [1, GVAR(EarplugsVolume)] select _hasEarPlugsIn;
// Handle Headgear
if (headgear ACE_player != "") then {
private _protection = (getNumber (configFile >> "CfgWeapons" >> (headgear ACE_player) >> QGVAR(protection))) min 1;
private _protection = getNumber (configFile >> "CfgWeapons" >> headgear ACE_player >> QGVAR(protection)) min 1;
GVAR(damageCoefficent) = GVAR(damageCoefficent) * (1 - _protection);
private _attenuation = (getNumber (configFile >> "CfgWeapons" >> (headgear ACE_player) >> QGVAR(lowerVolume))) min 1;
private _attenuation = getNumber (configFile >> "CfgWeapons" >> headgear ACE_player >> QGVAR(lowerVolume)) min 1;
GVAR(volumeAttenuation) = GVAR(volumeAttenuation) * (1 - _attenuation);
};
// Handle Goggles
if (goggles ACE_player != "") then {
private _protection = getNumber (configFile >> "CfgGlasses" >> goggles ACE_player >> QGVAR(protection)) min 1;
GVAR(damageCoefficent) = GVAR(damageCoefficent) * (1 - _protection);
private _attenuation = getNumber (configFile >> "CfgGlasses" >> goggles ACE_player >> QGVAR(lowerVolume)) min 1;
GVAR(volumeAttenuation) = GVAR(volumeAttenuation) * (1 - _attenuation);
};