2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-07-15 10:23:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Check if all items are present between the patient and the medic.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Medic <OBJECT>
|
|
|
|
* 1: Patient <OBJECT>
|
|
|
|
* 2: Items <ARRAY<STRING>>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
2016-07-15 10:23:47 +00:00
|
|
|
* Has the items <BOOL>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
2019-03-30 16:07:54 +00:00
|
|
|
* [bob, patient, ["bandage", "morphine"]] call ace_medical_treatment_fnc_hasItems
|
2017-06-08 13:31:51 +00:00
|
|
|
*
|
2019-03-30 16:07:54 +00:00
|
|
|
* Public: No
|
2016-07-15 10:23:47 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_medic", "_patient", "_items"];
|
|
|
|
|
|
|
|
private _return = true;
|
2016-09-29 17:31:48 +00:00
|
|
|
|
2016-07-15 10:23:47 +00:00
|
|
|
{
|
2016-09-29 17:31:48 +00:00
|
|
|
// handle a one of type use item
|
|
|
|
if (_x isEqualType [] && {{[_medic, _patient, _x] call FUNC(hasItem)} count _x == 0}) exitWith {
|
2016-07-15 10:23:47 +00:00
|
|
|
_return = false;
|
|
|
|
};
|
2016-09-29 17:31:48 +00:00
|
|
|
|
|
|
|
// handle required item
|
|
|
|
if (_x isEqualType "" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitWith {
|
2016-07-15 10:23:47 +00:00
|
|
|
_return = false;
|
|
|
|
};
|
2016-09-29 17:31:48 +00:00
|
|
|
} forEach _items;
|
2016-07-15 10:23:47 +00:00
|
|
|
|
|
|
|
_return
|