ACE3/addons/explosives/functions/fnc_hasExplosives.sqf
mharis001 8648ccaba5 Explosives - Optimize creating explosive place actions (#6413)
* Optimize explosive actions

* Optimize hasExplosives function

* Readability parentheses

* bump

* testing...

* last try

* for science

* fix for sqf_validator
2018-09-21 22:54:24 -05:00

25 lines
557 B
Plaintext

#include "script_component.hpp"
/*
* Author: Garth 'L-H' de Wet, mharis001
* Checks if given unit has any placeable explosives on them.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Has explosives <BOOL>
*
* Example:
* [player] call ace_explosives_fnc_hasExplosives
*
* Public: Yes
*/
params ["_unit"];
TRACE_1("params",_unit);
private _cfgMagazines = configFile >> "CfgMagazines";
private _magazines = magazines _unit;
((_magazines arrayIntersect _magazines) findIf {getNumber (_cfgMagazines >> _x >> QGVAR(Placeable)) == 1}) > -1