From 0111a8f5807b091223f2237dfb8bc6b029b4a800 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 31 Jul 2014 13:14:10 -0400 Subject: [PATCH] Change count back to forEach You can not nest count loops inside other count loops: https://community.bistudio.com/wiki/Code_Optimisation#forEach_vs_count --- SQF/dayz_code/actions/maintain_area.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SQF/dayz_code/actions/maintain_area.sqf b/SQF/dayz_code/actions/maintain_area.sqf index 6dc3f15d5..2f7db6f89 100644 --- a/SQF/dayz_code/actions/maintain_area.sqf +++ b/SQF/dayz_code/actions/maintain_area.sqf @@ -66,7 +66,7 @@ switch _option do { _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } count _requirements; + } forEach _requirements; if (_proceed) then { player playActionNow "Medic";