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

@@ -14,7 +14,7 @@ if (local _animalbody) then {
_timer = _this select 0;
_body = _this select 1;
_pos = getPosATL _body;
while {(count magazines _body >0) and (time - _timer < 300) } do {
while {(count magazines _body >0) && (time - _timer < 300) } do {
sleep 5;
};
@@ -24,11 +24,11 @@ if (local _animalbody) then {
_inRange = _pos nearEntities ["CAManBase",100];
{
// only send to other players
if(isPlayer _x and _x != player) then {
if(isPlayer _x && _x != player) then {
PVDZE_send = [_x,"HideBody",[_body]];
publicVariableServer "PVDZE_send";
};
} forEach _inRange;
} count _inRange;
sleep 5;
deleteVehicle _body;