Merge pull request #4078 from acemod/fixNavalMines

Allow defusing naval mines
This commit is contained in:
Nicolás Badano 2016-07-11 00:40:13 +02:00 committed by GitHub
commit aa01c0d940
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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);
};
};