mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #4078 from acemod/fixNavalMines
Allow defusing naval mines
This commit is contained in:
commit
aa01c0d940
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 0: Target <OBJECT>
|
||||
* 0: Target (ACE_DefuseObject) <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Able to defuse <BOOL>
|
||||
@ -19,15 +19,16 @@
|
||||
params ["_unit", "_target"];
|
||||
TRACE_2("params",_unit,_target);
|
||||
|
||||
private ["_isSpecialist"];
|
||||
|
||||
if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith {
|
||||
private _explosive = _target getVariable [QGVAR(Explosive), objNull];
|
||||
if (isNull _explosive) exitWith {
|
||||
deleteVehicle _target;
|
||||
false
|
||||
};
|
||||
if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (items _unit))}) exitWith {false};
|
||||
_isSpecialist = [_unit] call EFUNC(Common,isEOD);
|
||||
|
||||
if (GVAR(RequireSpecialist) && {!_isSpecialist}) 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
|
||||
|
@ -63,6 +63,6 @@ if (ACE_player != _unit) then {
|
||||
_isEOD = [_unit] call EFUNC(Common,isEOD);
|
||||
_defuseTime = [_isEOD, _target] call _fnc_DefuseTime;
|
||||
if (_isEOD || {!GVAR(RequireSpecialist)}) then {
|
||||
[_defuseTime, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize LSTRING(DefusingExplosive))] call EFUNC(common,progressBar);
|
||||
[_defuseTime, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize LSTRING(DefusingExplosive)), {true}, ["isNotSwimming"]] call EFUNC(common,progressBar);
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user