Merge pull request #4166 from acemod/glasses-hearing

Make hearing component compatible with glasses
This commit is contained in:
Glowbal 2016-08-13 14:17:47 +02:00 committed by GitHub
commit fdfe672491

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