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

@@ -6,7 +6,7 @@ _error = _this select 2;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
_nearByObjects = nearestObjects [player,_objects,_range];
@@ -15,7 +15,7 @@ if (count _nearByObjects == 0) exitWith {
};
_targetObject = _nearByObjects select 0;
if (!isNull _targetObject and _canDo) then {
if (!isNull _targetObject && _canDo) then {
[0,1,2,_targetObject] spawn player_removeObject;
} else {
cutText [(localize _error), "PLAIN DOWN"];