improve checkItems function

This commit is contained in:
commy2 2016-09-29 21:32:54 +02:00
parent f53d324c0d
commit 03e24d8fd9

View File

@ -1,5 +1,5 @@
/*
* Author: KoffeinFlummi
* Author: KoffeinFlummi, commy2
* Replaces vanilla items with ACE ones.
*
* Arguments:
@ -8,30 +8,28 @@
* ReturnValue:
* None
*
* Public: Yes
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
while {({_x == "FirstAidKit"} count items _unit) > 0} do {
_unit removeItem "FirstAidKit";
if (EGVAR(medical,level) >= 2) then {
private _countFirstAidKit = {_x == "FirstAidKit"} count items _unit;
_unit removeItems "FirstAidKit";
private _countMedikit = {_x == "Medikit"} count items _unit;
_unit removeItems "Medikit";
if (EGVAR(medical,level) >= 2) then {
// --- advanced
for "" from 1 to _countFirstAidKit do {
_unit addItem "ACE_fieldDressing";
_unit addItem "ACE_packingBandage";
_unit addItem "ACE_morphine";
_unit addItem "ACE_tourniquet";
} else {
_unit addItem "ACE_fieldDressing";
_unit addItem "ACE_fieldDressing";
_unit addItem "ACE_morphine";
};
};
while {({_x == "Medikit"} count items _unit) > 0} do {
_unit removeItem "Medikit";
if (EGVAR(medical,level) >= 2) then {
for "" from 1 to _countMedikit do {
_unit addItemToBackpack "ACE_fieldDressing";
_unit addItemToBackpack "ACE_packingBandage";
_unit addItemToBackpack "ACE_packingBandage";
@ -39,7 +37,16 @@ while {({_x == "Medikit"} count items _unit) > 0} do {
_unit addItemToBackpack "ACE_morphine";
_unit addItemToBackpack "ACE_salineIV_250";
_unit addItemToBackpack "ACE_tourniquet";
} else {
};
} else {
// --- basic
for "" from 1 to _countFirstAidKit do {
_unit addItem "ACE_fieldDressing";
_unit addItem "ACE_fieldDressing";
_unit addItem "ACE_morphine";
};
for "" from 1 to _countMedikit do {
_unit addItemToBackpack "ACE_epinephrine";
_unit addItemToBackpack "ACE_epinephrine";
_unit addItemToBackpack "ACE_epinephrine";