make FUNC(scriptedExplosive) work in scheduled env, ref #3621

This commit is contained in:
commy2
2016-03-29 13:21:13 +02:00
parent 4e3b342a7f
commit 666a4030b5

View File

@ -4,7 +4,7 @@
* detonate editor-placed explosives. * detonate editor-placed explosives.
* *
* Arguments: * Arguments:
* 0: Explosives objects to detonate <ARRAY> * 0: Explosives objects to detonate <OBJECT or ARRAY>
* 1: Fuze delay (for each explosive; use negative number for random time up to value) <NUMBER> <OPTIONAL> * 1: Fuze delay (for each explosive; use negative number for random time up to value) <NUMBER> <OPTIONAL>
* *
* Return Value: * Return Value:
@ -18,10 +18,13 @@
*/ */
#include "script_component.hpp" #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); [objNull, -1, [_x, _detTime]] call FUNC(detonateExplosive);
} forEach _explosiveArr; } forEach _explosiveArr;