From 04412e8ba49cbf7bfc031dd5a4de2100c33a2beb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Mar 2015 16:46:06 -0500 Subject: [PATCH] Replace spawn with waitAndExec --- addons/hearing/functions/fnc_explosionNear.sqf | 5 +---- addons/hearing/functions/fnc_firedNear.sqf | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index 418916cc8e..b213a1304a 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -24,7 +24,4 @@ _damage = _this select 1; _strength = (_damage * 2) min 1; if (_strength < 0.01) exitWith {}; -[_unit, _strength] spawn { - sleep 0.2; - _this call FUNC(earRinging); -}; +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 9b110fbbbb..83d50776f7 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -56,7 +56,4 @@ _strength = _loudness - (_loudness/50 * _distance); // linear drop off if (_strength < 0.01) exitWith {}; -[_unit, _strength] spawn { - sleep 0.2; - _this call FUNC(earRinging); -}; +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute);