mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Replace forEach with Count
Use count where you do not need _forEachIndex variable, it's quicker than forEach.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
Description:
|
||||
Checks whether the player has the required items (magazines) or not
|
||||
and displays a message if an item is missing.
|
||||
Checks whether the player has the required items (magazines) || not
|
||||
&& displays a message if an item is missing.
|
||||
|
||||
Parameter(s):
|
||||
_this: <array> list of item names the player is required to have (can also be an sub-array with item name and quantity)
|
||||
_this: <array> list of item names the player is required to have (can also be an sub-array with item name && quantity)
|
||||
|
||||
Returns:
|
||||
Boolean (true if the player has all required items)
|
||||
@@ -41,5 +41,5 @@ _hasItems = true;
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format[(localize "STR_EPOCH_ACTIONS_12"), _missingQty, _textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} forEach _items;
|
||||
} count _items;
|
||||
_hasItems
|
||||
|
||||
Reference in New Issue
Block a user