mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-20 10:26:28 +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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user