From 9e6ce52fb6c0017c048c97fbf70fa90fbbe59145 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 28 Jun 2015 21:25:01 +0200 Subject: [PATCH] Added check to addEarplugs if earplugs are used --- addons/hearing/functions/fnc_addEarPlugs.sqf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index 455de07fd9..8e4c5eafef 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -15,9 +15,12 @@ */ #include "script_component.hpp" -private ["_unit", "_launcher"]; +PARAMS_1(_unit); -_unit = _this select 0; +// Exit if soldier has earplugs already in (persistence scenarios) +if (FUNC(hasEarPlugsIn)) exitWith {}; + +private ["_launcher"]; // add earplugs if the soldier has a rocket launcher _launcher = secondaryWeapon _unit;