ACE3/addons/explosives/functions/fnc_hasExplosives.sqf

32 lines
597 B
Plaintext
Raw Normal View History

/*
* Author: Garth 'L-H' de Wet
* Whether the passed unit has any explosives on them.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* The unit has explosives <BOOL>
*
* Example:
2015-08-15 19:35:33 +00:00
* hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives;
*
* Public: Yes
*/
#include "script_component.hpp"
2015-04-29 05:05:02 +00:00
2015-08-15 19:35:33 +00:00
params ["_unit"];
TRACE_1("params",_unit);
private ["_result", "_magazines"];
_result = false;
_magazines = magazines _unit;
{
2016-01-14 22:05:56 +00:00
if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> QGVAR(Placeable)) == 1) exitWith {
_result = true;
};
} count _magazines;
_result