Replace forEach with Count

Use count where you do not need _forEachIndex variable, it's quicker
than forEach.
This commit is contained in:
icomrade
2014-05-27 15:37:57 -04:00
parent 91d246e64e
commit e54b9983dd
210 changed files with 890 additions and 890 deletions

View File

@@ -9,7 +9,7 @@ _activatingPlayer = _this select 5;
_characterID = _keySelected;
_isOK = isClass(configFile >> "CfgVehicles" >> _class);
if(!_isOK or isNull _object) exitWith { diag_log ("HIVE-pv3: Vehicle does not exist: "+ str(_class)); };
if(!_isOK || isNull _object) exitWith { diag_log ("HIVE-pv3: Vehicle does not exist: "+ str(_class)); };
diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0;
@@ -96,7 +96,7 @@ _key call server_hiveWrite;
{
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} forEach _objWpnTypes;
} count _objWpnTypes;
//Add Magazines
_objWpnTypes = _magazines select 0;
@@ -105,7 +105,7 @@ _key call server_hiveWrite;
{
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} forEach _objWpnTypes;
} count _objWpnTypes;
//Add Backpacks
_objWpnTypes = _backpacks select 0;
@@ -114,7 +114,7 @@ _key call server_hiveWrite;
{
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} forEach _objWpnTypes;
} count _objWpnTypes;
_object setVariable ["ObjectID", _oid, true];