diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index f4db19e6ea..cda5fa508e 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -28,11 +28,12 @@ if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { //headgear hearing protection if(headgear _unit != "") then { - private ["_protection"]; - _protection = (getNumber (configFile >> "CfgWeapons" >> (headgear _unit) >> QGVAR(protection))) min 1; + private _protection = (getNumber (configFile >> "CfgWeapons" >> (headgear _unit) >> QGVAR(protection))) min 1; if(_protection > 0) then { _strength = _strength * (1 - _protection); }; }; +TRACE_2("adding",_strength,GVAR(deafnessDV)); + GVAR(deafnessDV) = GVAR(deafnessDV) + _strength; diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index ece047d545..31f693bafd 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -97,4 +97,4 @@ TRACE_1("result",_strength); if (_strength < 0.01) exitWith {}; -// [{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2] call EFUNC(common,waitAndExecute); +[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index e36151aea4..5492dcd080 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 and esteldunedain and Ruthberg - * Updates and applys the current deafness. Called every 0.1 sec from a PFEH. + * Updates and applys the current deafness. Called every 1 sec from a PFEH. * * Arguments: * 0: Args @@ -19,7 +19,6 @@ //Only run if deafness or ear ringing is enabled: if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; -private["_volume", "_soundTransitionTime"]; (_this select 0) params ["_justUpdateVolume"]; @@ -71,7 +70,7 @@ if (!_justUpdateVolume) then { if ((missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false]) || {!GVAR(enableCombatDeafness)}) exitWith {}; -_volume = GVAR(volume); +private _volume = GVAR(volume); // Earplugs reduce hearing 50% if ([ACE_player] call FUNC(hasEarPlugsIn)) then { @@ -92,7 +91,7 @@ if (ACE_player getVariable ["ACE_isUnconscious", false]) then { _volume = _volume min GVAR(UnconsciousnessVolume); }; -_soundTransitionTime = if (_justUpdateVolume) then {0.1} else {1}; +private _soundTransitionTime = if (_justUpdateVolume) then {0.1} else {1}; _soundTransitionTime fadeSound _volume; _soundTransitionTime fadeSpeech _volume;