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

@@ -92,7 +92,7 @@ if (!isDedicated) then { //dw, particle stuff don't need run on dedicated
clearvehicleinit _v;
deleteVehicle _v;
_v =(_wreck) createvehicle _pos;
{_x moveincargo _v} foreach _crw;
{_x moveincargo _v} count _crw;
_v setVectorDirAndUp [_dir,_vecUp];
_v setFuel 0;
_v setdamage 0;
@@ -126,7 +126,7 @@ else
clearvehicleinit _v;
deleteVehicle _v;
_v =(_wreck) createvehicle _pos;
{_x moveincargo _v} foreach _crw;
{_x moveincargo _v} count _crw;
//sleep 0.05;
_v setvelocity _vel;
//_v setPos _pos;

View File

@@ -10,7 +10,7 @@ if (count _this > 2) then {_lifecheck=_this select 2};
_int = _int min 3;
if (!((_v isKindOf "Air")OR{((_v isKindOf "LandVehicle")OR{(_v isKindOf "Ship")})})) exitWith {};
if (!((_v isKindOf "Air")||{((_v isKindOf "LandVehicle")||{(_v isKindOf "Ship")})})) exitWith {};
_effect2pos = _v selectionposition "destructionEffect2";
@@ -24,4 +24,4 @@ while {_int>1} do
sleep _x;
if((_lifecheck&&(alive _v))||(isnull _v)||(((getposASL _v)select 2)<0))exitwith{};
createVehicle ["SmallSecondary", (_v modelToWorld _effect2pos), [], 0, "CAN_COLLIDE"];
}foreach(_list);
}count(_list);