2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 08:35:17 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Causes the unit to defuse the passed explosive.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Explosive <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, ACE_Interaction_Target] call ACE_Explosives_fnc_defuseExplosive;
|
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
2015-01-13 21:21:31 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-08-15 19:35:33 +00:00
|
|
|
params ["_unit", "_explosive"];
|
|
|
|
TRACE_2("params",_unit,_explosive);
|
|
|
|
|
2016-01-14 22:05:56 +00:00
|
|
|
if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> QGVAR(explodeOnDefuseChance)))}) exitWith {
|
2015-08-15 19:35:33 +00:00
|
|
|
TRACE_1("exploding on defuse",_explosive);
|
2017-05-10 16:28:44 +00:00
|
|
|
[_unit, -1, [_explosive, 1], "#ExplodeOnDefuse"] call FUNC(detonateExplosive);
|
2016-05-22 15:29:05 +00:00
|
|
|
[QGVAR(explodeOnDefuse), [_explosive, _unit]] call CBA_fnc_globalEvent;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_unit action ["Deactivate", _unit, _explosive];
|
2016-05-22 15:29:05 +00:00
|
|
|
[QGVAR(defuse), [_explosive, _unit]] call CBA_fnc_globalEvent;
|