diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index b80ae51818..d8b21f214a 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -79,18 +79,3 @@ GVAR(lastPlayerVehicle) = objNull; // Update protection on possible helmet change ["loadout", LINKFUNC(updateHearingProtection), false] call CBA_fnc_addPlayerEventHandler; }] call CBA_fnc_addEventHandler; - -["CBA_loadoutSet", { - params ["_unit", "_loadout", "_extendedInfo"]; - if (_extendedInfo getOrDefault ["ace_earplugs", false]) then { - _unit setVariable ["ACE_hasEarPlugsIn", true, true]; - [[true]] remoteExec [QFUNC(updateVolume), _unit]; - }; -}] call CBA_fnc_addEventHandler; - -["CBA_loadoutGet", { - params ["_unit", "_loadout", "_extendedInfo"]; - if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { - _extendedInfo set ["ace_earplugs", true] - }; -}] call CBA_fnc_addEventHandler; diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index 9361d05015..5d6b275adc 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -8,4 +8,19 @@ PREP_RECOMPILE_END; #include "initSettings.sqf" +["CBA_loadoutSet", { + params ["_unit", "_loadout", "_extendedInfo"]; + if (_extendedInfo getOrDefault ["ace_earplugs", false]) then { + _unit setVariable ["ACE_hasEarPlugsIn", true, true]; + [[true]] remoteExec [QFUNC(updateVolume), _unit]; + }; +}] call CBA_fnc_addEventHandler; + +["CBA_loadoutGet", { + params ["_unit", "_loadout", "_extendedInfo"]; + if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { + _extendedInfo set ["ace_earplugs", true] + }; +}] call CBA_fnc_addEventHandler; + ADDON = true;