ACE3/addons/repair/functions/fnc_hasItems.sqf
Dedmen Miller 81e02a7336 Refactor private ARRAY to private keyword (#5598)
* Everything

* Fixed missing ;

* Fix missing ; and double private

* Fixed cannot isNull on number

* Turn _temparture back to isNil

* Fix error from merge
2017-10-10 09:39:59 -05:00

33 lines
682 B
Plaintext

/*
* Author: Glowbal
* Check if the engineer has all items.
*
* Arguments:
* 0: Unit that does the repairing <OBJECT>
* 1: Items required <ARRAY>
*
* Return Value:
* Has Items <BOOL>
*
* Example:
* [engineer, [items]] call ace_repair_fnc_hasItems
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", "_items"];
TRACE_2("params",_unit,_items);
private _return = true;
{
if ((_x isEqualType []) && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitWith {
_return = false;
};
if ((_x isEqualType "") && {!([_unit, _x] call EFUNC(common,hasItem))}) exitWith {
_return = false;
};
} forEach _items;
_return;