File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,11 +20,14 @@ if !(EGVAR(common,settingsInitFinished)) exitWith {
2020 EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addEarPlugs), _this ];
2121};
2222
23+ // Exit if hearing is disabled or if autoAdd is disabled
24+ if (! GVAR(enableCombatDeafness) || {GVAR(autoAddEarplugsToUnits) == 0 }) exitWith {};
25+
2326params [" _unit" ];
2427TRACE_2(" params" ,_unit ,typeOf _unit );
2528
26- // Exit if hearing is disabled OR autoAdd is disabled OR soldier has earplugs already in (persistence scenarios)
27- if (! GVAR(enableCombatDeafness) || {GVAR(autoAddEarplugsToUnits) == 0 } || {[_unit ] call FUNC(hasEarPlugsIn )}) exitWith {};
29+ // Exit if the unit already has earplugs ( in ears (persistence scenarios) or inventory )
30+ if (_unit call FUNC(hasEarPlugsIn) || {[_unit , " ACE_EarPlugs " ] call EFUNC(common,hasItem )}) exitWith {};
2831
2932// Add earplugs if enabled for everyone or if the soldier has a rocket launcher
3033if (GVAR(autoAddEarplugsToUnits) == 2 || {(secondaryWeapon _unit ) ! = " " }) exitWith {
You can’t perform that action at this time.
0 commit comments