From 666a4030b51ffbde67b160cda21084b8b97380b8 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Mar 2016 13:21:13 +0200 Subject: [PATCH] make FUNC(scriptedExplosive) work in scheduled env, ref #3621 --- addons/explosives/functions/fnc_scriptedExplosive.sqf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/explosives/functions/fnc_scriptedExplosive.sqf b/addons/explosives/functions/fnc_scriptedExplosive.sqf index b4abb204b3..6a554ac09c 100644 --- a/addons/explosives/functions/fnc_scriptedExplosive.sqf +++ b/addons/explosives/functions/fnc_scriptedExplosive.sqf @@ -4,7 +4,7 @@ * detonate editor-placed explosives. * * Arguments: - * 0: Explosives objects to detonate + * 0: Explosives objects to detonate * 1: Fuze delay (for each explosive; use negative number for random time up to value) * * Return Value: @@ -18,10 +18,13 @@ */ #include "script_component.hpp" -params ["_explosiveArr",["_fuzeTime",0]]; +params [["_explosiveArr", [], [[], objNull]], ["_fuzeTime", 0, [0]]]; + +if (_explosiveArr isEqualType objNull) then { + _explosiveArr = [_explosiveArr]; +}; -private _detTime; { - _detTime = if (_fuzeTime < 0) then {random abs _fuzeTime} else {_fuzeTime}; + private _detTime = if (_fuzeTime < 0) then {random abs _fuzeTime} else {_fuzeTime}; [objNull, -1, [_x, _detTime]] call FUNC(detonateExplosive); } forEach _explosiveArr;