Skip to content

Commit

Permalink
Fix EHP muting with built in EHP
Browse files Browse the repository at this point in the history
  • Loading branch information
BaerMitUmlaut committed Nov 3, 2024
1 parent abb6926 commit d658c13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/hearing/functions/fnc_earRinging.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ if (!GVAR(enabledForZeusUnits) && {player != ACE_player}) exitWith {};
TRACE_2("adding",_strength * GVAR(damageCoefficent),GVAR(deafnessDV));

// Handle volume reduction by electronic hearing protection
if (_strength >= EHP_MIN_STRENGTH && {ACE_player getVariable ["ACE_hasEHP", false]}) then {
if (
_strength >= EHP_MIN_STRENGTH
&& {ACE_player getVariable ["ACE_hasEHP", false] || {ACE_player getVariable ["ACE_hasBuiltInEHP", false]}}
) then {
if (GVAR(ehpTimeout) == -1) then {
[QGVAR(ehp), EHP_REDUCTION * GVAR(volumeAttenuation), true] call EFUNC(common,setHearingCapability);

Expand Down
2 changes: 2 additions & 0 deletions addons/hearing/functions/fnc_updateHearingProtection.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ if (_hasEHPOn && _hasBuiltInEHP) then {
if (_hasEHPOn || _hasBuiltInEHP) then {
GVAR(damageCoefficent) = GVAR(damageCoefficent) * 0.25;
};

ACE_player setVariable ["ACE_hasBuiltInEHP", _hasBuiltInEHP];

0 comments on commit d658c13

Please sign in to comment.