mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
803d497d8a
* Add uniqueItems function * Optimize dogtag children actions function * Optimize getDetonators item search * Store CfgWeapons lookup in getDetonators * Update items to use new function * Update items to use new function 2 * More optimization of uniqueItems function * Update items to use new function 3
35 lines
946 B
Plaintext
35 lines
946 B
Plaintext
/*
|
|
* Author: Garth 'L-H' de Wet
|
|
* Whether a unit can perform the defuse action
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 0: Target (ACE_DefuseObject) <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Able to defuse <BOOL>
|
|
*
|
|
* Example:
|
|
* if ([player] call ACE_Explosives_fnc_canDefuse) then {hint "Can Defuse";};
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit", "_target"];
|
|
TRACE_2("params",_unit,_target);
|
|
|
|
private _explosive = _target getVariable [QGVAR(Explosive), objNull];
|
|
if (isNull _explosive) exitWith {
|
|
deleteVehicle _target;
|
|
false
|
|
};
|
|
if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (_unit call EFUNC(common,uniqueItems)))}) exitWith {false};
|
|
|
|
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};
|
|
|
|
true
|