From fefb599a5531b9e18566695239159c42fa3a4b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 17 Jan 2015 03:09:51 -0300 Subject: [PATCH] explosives: change addPerFrameHandler to waitAndExecute --- .../explosives/functions/fnc_startTimer.sqf | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/addons/explosives/functions/fnc_startTimer.sqf b/addons/explosives/functions/fnc_startTimer.sqf index e2f0145d47..8df46261fe 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -16,22 +16,12 @@ [_explosive, 10] call ACE_Explosives_fnc_startTimer; */ #include "script_component.hpp" + +EXPLODE_2_PVT(_this,_explosive,_delay; + [{ - EXPLODE_2_PVT(_this,_params,_pfhId); - - private ["_placeTime", "_fuseTime", "_explosive"]; - _placeTime = _params select 1; - _fuseTime = _params select 0 select 1; - - // Exit if it's not time to detonate yet - if (time < _placeTime + _fuseTime) exitWith {}; - - // Remove the PFH - [_pfhId] call cba_fnc_removePerFrameHandler; - - _explosive = (_params select 0) select 0; + _explosive = _this; if (!isNull _explosive) then { [_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive); }; - -},0, [_this, time]] call CBA_fnc_addPerFrameHandler; +}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute); \ No newline at end of file