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

@@ -24,14 +24,14 @@ _intersectsWith = lineIntersectsWith [_playerPos, _vehiclePos, player, _vehicle]
if ((count _intersectsWith) > 0) then {
{
// buildings
if (_x isKindOf "Building" or _x isKindOf "DZE_Housebase") exitWith {
if (_x isKindOf "Building" || _x isKindOf "DZE_Housebase") exitWith {
_activated = true;
};
// walls
if ((typeOf _x) == "" and {["wall_", str _x, false] call fnc_inString}) exitWith {
if ((typeOf _x) == "" && {["wall_", str _x, false] call fnc_inString}) exitWith {
_activated = true;
};
} forEach _intersectsWith;
} count _intersectsWith;
};
if(_activated) then {