ACE3/addons/explosives/functions/fnc_allowDefuse.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

34 lines
686 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Walthzer
* Sets if a dynamic defuse action is allowed to be added to a mine.
*
* Arguments:
* 0: Mine <OBJECT>
* 1: Allow defusal <BOOL>
*
* Return Value:
* Succes <BOOLEAN>
*
* Example:
* [_mine, false] call ace_explosives_fnc_allowDefuse
*
* Public: Yes
*/
params [["_mine", objNull, [objNull]], ["_allow", true, [true]]];
TRACE_2("params",_mine,_allow);
if !(_mine in allMines) exitWith {false};
if (_allow && {!([_mine] call FUNC(isAllowedDefuse))}) exitWith {
GVAR(excludedMines) = GVAR(excludedMines) - [_mine];
true
};
if (!_allow) exitWith {
GVAR(excludedMines) pushBackUnique _mine != -1
};
false