2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
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>
|
2023-04-30 21:03:35 +00:00
|
|
|
* 1: Target (ACE_DefuseObject) <OBJECT>
|
2015-02-02 08:35:17 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Able to defuse <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* if ([player] call ACE_Explosives_fnc_canDefuse) then {hint "Can Defuse";};
|
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
2015-08-15 19:35:33 +00:00
|
|
|
|
|
|
|
params ["_unit", "_target"];
|
|
|
|
TRACE_2("params",_unit,_target);
|
|
|
|
|
2016-07-10 22:29:19 +00:00
|
|
|
private _explosive = _target getVariable [QGVAR(Explosive), objNull];
|
|
|
|
if (isNull _explosive) exitWith {
|
2015-04-01 18:43:18 +00:00
|
|
|
deleteVehicle _target;
|
|
|
|
false
|
|
|
|
};
|
2023-09-01 20:52:28 +00:00
|
|
|
if (vehicle _unit != _unit || {(_unit call EFUNC(common,uniqueItems)) findAny GVAR(defusalKits) == -1}) exitWith {false};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2016-07-10 22:29:19 +00:00
|
|
|
if (GVAR(RequireSpecialist) && {!([_unit] call EFUNC(Common,isEOD))}) exitWith {false};
|
|
|
|
|
|
|
|
//Handle the naval mines (which doens't get turned into items when defused):
|
|
|
|
if ((_explosive isKindOf "UnderwaterMine_Range_Ammo") && {!mineActive _explosive}) exitWith {false};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-03-31 21:20:32 +00:00
|
|
|
true
|