2015-07-03 21:14:23 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Check if the engineer has all items.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-16 18:14:54 +00:00
|
|
|
* 0: Unit that does the repairing <OBJECT>
|
|
|
|
* 1: Items required <ARRAY>
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
2015-08-16 18:14:54 +00:00
|
|
|
* Return Value:
|
|
|
|
* Has Items <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [engineer, [items]] call ace_repair_fnc_hasItems
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-16 18:14:54 +00:00
|
|
|
params ["_unit", "_items"];
|
|
|
|
TRACE_2("params",_unit,_items);
|
2015-08-09 06:54:44 +00:00
|
|
|
|
|
|
|
private ["_return"];
|
2015-07-03 21:14:23 +00:00
|
|
|
|
|
|
|
_return = true;
|
|
|
|
{
|
2015-08-16 18:14:54 +00:00
|
|
|
if (typeName _x == "ARRAY" && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitwith {
|
2015-07-03 21:14:23 +00:00
|
|
|
_return = false;
|
|
|
|
};
|
2015-08-16 18:14:54 +00:00
|
|
|
if (typeName _x == "STRING" && {!([_unit, _x] call EFUNC(common,hasItem))}) exitwith {
|
2015-07-03 21:14:23 +00:00
|
|
|
_return = false;
|
|
|
|
};
|
2015-08-09 06:54:44 +00:00
|
|
|
} forEach _items;
|
2015-07-03 21:14:23 +00:00
|
|
|
|
|
|
|
_return;
|