2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 08:35:17 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Whether a unit can perform the defuse action
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Able to defuse <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* if ([player] call ACE_Explosives_fnc_canDefuse) then {hint "Can Defuse";};
|
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
2015-01-13 21:21:31 +00:00
|
|
|
#include "script_component.hpp"
|
2015-04-29 05:05:02 +00:00
|
|
|
private ["_isSpecialist"];
|
2015-04-01 18:43:18 +00:00
|
|
|
EXPLODE_2_PVT(_this,_unit,_target);
|
|
|
|
if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith {
|
|
|
|
deleteVehicle _target;
|
|
|
|
false
|
|
|
|
};
|
2015-01-12 09:48:26 +00:00
|
|
|
if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (items _unit))}) exitWith {false};
|
2015-01-12 20:39:37 +00:00
|
|
|
_isSpecialist = [_unit] call EFUNC(Common,isEOD);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-12 09:48:26 +00:00
|
|
|
if (GVAR(RequireSpecialist) && {!_isSpecialist}) exitWith {false};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-03-31 21:20:32 +00:00
|
|
|
true
|