2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-02-22 17:38:06 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Check if all items are present between the patient and the medic.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Medic <OBJECT>
|
|
|
|
* 1: Patient <OBJECT>
|
2015-02-22 18:50:14 +00:00
|
|
|
* 2: Items <ARRAY<STRING>>
|
2015-02-22 17:38:06 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
2015-02-22 18:50:14 +00:00
|
|
|
* Has the items <BOOL>
|
2015-02-22 17:38:06 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob, patient, ["bandage", "morphine"]] call ace_medical_fnc_hasItems
|
|
|
|
*
|
2015-02-22 17:38:06 +00:00
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
params ["_medic", "_patient", "_items"];
|
2015-02-22 17:38:06 +00:00
|
|
|
|
2016-06-13 00:34:56 +00:00
|
|
|
private _return = true;
|
2015-02-22 17:38:06 +00:00
|
|
|
{
|
2015-02-28 18:28:05 +00:00
|
|
|
//
|
2015-11-20 17:40:31 +00:00
|
|
|
if (_x isEqualType [] && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith {
|
2015-02-28 18:28:05 +00:00
|
|
|
_return = false;
|
|
|
|
};
|
2015-11-20 17:40:31 +00:00
|
|
|
if (_x isEqualType "" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith {
|
2015-02-28 18:28:05 +00:00
|
|
|
_return = false;
|
|
|
|
};
|
2015-02-22 17:38:06 +00:00
|
|
|
}foreach _items;
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
_return
|