ACE3/addons/explosives/functions/fnc_allowDefuse.sqf
Walthzer fad7f84625
Explosives - Add exclusion from dynamic defuse action (#8171)
* Add GVAR(noDefusalAction)

* add changes

* Prep functions

* Update addons/explosives/functions/fnc_excludeMine.sqf

Uhm, strange. Its clearly allMines, yet Allmines didn't only build it also worked properly. Undocumented variable?

Co-authored-by: BaerMitUmlaut <BaerMitUmlaut@users.noreply.github.com>

* Update addons/explosives/functions/fnc_stopExcludingMine.sqf

Co-authored-by: BaerMitUmlaut <BaerMitUmlaut@users.noreply.github.com>

* Header Fixes

Fix information in the function headers

Co-authored-by: jonpas <jonpas33@gmail.com>

* Remove Individual Functions

* Compacter Functions

* Event

* remove tab (facepalm)

* Jonpass' Review Fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Fix exitWith mistake

* Refractor of allowDefuse

Co-authored-by: jonpas <jonpas33@gmail.com>

* Update addons/explosives/functions/fnc_allowDefuse.sqf

Co-authored-by: jonpas <jonpas33@gmail.com>

* Update Documentation

* Rephrase documentation

* Another rephrase

* Relabel Locality

* Update addons/explosives/functions/fnc_allowDefuse.sqf

Co-authored-by: BaerMitUmlaut <BaerMitUmlaut@users.noreply.github.com>
Co-authored-by: jonpas <jonpas33@gmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2021-10-11 15:49:27 -05:00

34 lines
683 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