ACE3/addons/explosives/functions/fnc_defuseExplosive.sqf

25 lines
618 B
Plaintext
Raw Normal View History

/*
* 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
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_explosive);
2015-06-15 19:55:49 +00:00
if (GVAR(ExplodeOnDefuse) && (random 1.0) < getNumber(ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse")) exitWith {
[_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive);
};
_unit action ["Deactivate", _unit, _explosive];