General - Change count to forEach where appropriate (#9890)

count -> forEach

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
johnb432 2024-04-04 13:15:26 +02:00 committed by GitHub
parent ccb3e65734
commit 8f46ffd8d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
73 changed files with 108 additions and 188 deletions

View File

@ -16,9 +16,8 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
{
private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo");
if (_ammo != "") then { GVAR(ammoMagLookup) setVariable [_ammo, _x]; };
} count (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"));
nil
} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
} forEach (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"));
} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
// Add keybinds

View File

@ -44,8 +44,7 @@
_addedPickUpHelpers pushBack _pickUpHelper;
_throwablesHelped pushBack _x;
};
nil
} count _nearThrowables;
} forEach _nearThrowables;
_args set [0, getPosASL ACE_player];
_args set [3, _nearThrowables];
@ -56,11 +55,10 @@
{
// Only handling with attachTo works nicely
_x attachTo [_x getVariable [QGVAR(throwable), objNull], [0, 0, 0]];
nil
} count _addedPickUpHelpers;
} forEach _addedPickUpHelpers;
} else {
TRACE_1("Cleaning Pick Up Helpers",count _addedPickUpHelpers);
{deleteVehicle _x} count _addedPickUpHelpers;
{deleteVehicle _x} forEach _addedPickUpHelpers;
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
}, 0, [(getPosASL ACE_player) vectorAdd [-100, 0, 0], [], [], []]] call CBA_fnc_addPerFrameHandler;

View File

@ -30,6 +30,6 @@ _vehicle == vehicle _unit
if (_unit == _x select FULLCREW_UNIT) exitWith {
_ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH];
};
} count fullCrew _vehicle;
} forEach fullCrew _vehicle;
_vehicle getVariable [_ejectVarName, false]
}

View File

@ -145,8 +145,7 @@ if (isServer) then {
INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`",[_x] call FUNC(getName),_dcPlayer,_x);
_x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true];
};
nil
} count (curatorEditableObjects _zeusLogic);
} forEach (curatorEditableObjects _zeusLogic);
};
}];
};

View File

@ -43,8 +43,7 @@ if (isServer) then {
{
_x params ["", "_eventArgs","_ttl"];
[_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent);
false
} count _eventLog;
} forEach _eventLog;
INFO_1("[%1] synchronized",_eventName);
};

View File

@ -28,9 +28,7 @@ if (_list isEqualType "") then {
};
{
if (!isNil "_x") then {
if (_x isEqualType objNull) then {
if (local _x) then {
if (!isNil "_x" && {_x isEqualType objNull} && {local _x}) then {
if (_vehicle) then {
(vehicle _x) setVariable [_variable, _setting, _global];
TRACE_6("Set variable vehicle",_x,vehicle _x,typeOf (vehicle _x),_variable,_setting,_global);
@ -39,7 +37,4 @@ if (_list isEqualType "") then {
TRACE_5("Set variable",_x,typeOf _x,_variable,_setting,_global);
};
};
};
};
false
} count _list;
} forEach _list;

View File

@ -66,8 +66,7 @@ GVAR(settingsMovedToSQF) = [];
INFO_1("%1 delayed functions running.",count GVAR(runAtSettingsInitialized));
{
(_x select 1) call (_x select 0);
false
} count GVAR(runAtSettingsInitialized);
} forEach GVAR(runAtSettingsInitialized);
GVAR(runAtSettingsInitialized) = nil; //cleanup
#ifdef DEBUG_MODE_FULL

View File

@ -53,8 +53,7 @@ private _refresh = {
{
ctrlDelete _x;
false
} count _allControls;
} forEach _allControls;
_allControls = [];
@ -80,7 +79,6 @@ private _refresh = {
_ctrl ctrlSetTextColor _xcolor;
_ctrl ctrlCommit 0;
_allControls pushBack _ctrl;
false
} forEach (missionNamespace getVariable [QGVAR(displayIconList),[]]);
};
@ -116,8 +114,7 @@ if (_show) then {
if (_x select 0 != _iconId) then {
_newList pushBack _x;
};
false
} count _list;
} forEach _list;
missionNamespace setVariable [QGVAR(displayIconList), _newList];
call _refresh;

View File

@ -34,8 +34,7 @@ if (IS_ARRAY(_var)) then {
{
[_x, _depth] call FUNC(dumpArray);
false
} count _var;
} forEach _var;
diag_log text format ["%1],", _pad];
};

View File

@ -25,8 +25,7 @@ if (!isNil "ACE_PFH_COUNTER") then {
private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)};
diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2];
false
} count ACE_PFH_COUNTER;
} forEach ACE_PFH_COUNTER;
};
diag_log text format ["ACE COUNTER RESULTS"];
@ -50,8 +49,7 @@ diag_log text format ["-------------------------------------------"];
};
_iter = _iter + 1;
false
} count _counterEntry;
} forEach _counterEntry;
// results
_averageResult = (_total / _count) * 1000;
@ -61,8 +59,7 @@ diag_log text format ["-------------------------------------------"];
} else {
diag_log text format ["%1: No results", _counterEntry select 0];
};
false
} count ACE_COUNTERS;
} forEach ACE_COUNTERS;
/*
// Dump PFH Trackers

View File

@ -50,8 +50,7 @@ if (_unit isKindOf "CAManBase") then {
_gunner = _unit turretUnit _x;
_turret = _x;
};
false
} count allTurrets [_unit, true];
} forEach allTurrets [_unit, true];
// Ensure that at least the pilot is returned if there is no gunner
if (isManualFire _unit && {isNull _gunner}) then {
_gunner = effectiveCommander _unit;

View File

@ -35,7 +35,6 @@ private _return = [];
_return pushBack [_x select 0, typeName _val, _val, _x select 2, _x select 5];
};
};
false
} count GVAR(OBJECT_VARIABLES_STORAGE);
} forEach GVAR(OBJECT_VARIABLES_STORAGE);
_return

View File

@ -29,7 +29,6 @@ private _doorTurrets = [];
if (((getNumber (_config >> "isCopilot")) == 0) && {count getArray (_config >> "weapons") > 0}) then {
_doorTurrets pushBack _x;
};
false
} count _turrets;
} forEach _turrets;
_doorTurrets

View File

@ -28,8 +28,7 @@ private _gunner = objNull;
if (_weapon in (_vehicle weaponsTurret _x)) exitWith {
_gunner = _vehicle turretUnit _x;
};
false
} count allTurrets [_vehicle, true];
} forEach allTurrets [_vehicle, true];
// ensure that at least the pilot is returned if there is no gunner
if (isManualFire _vehicle && {isNull _gunner}) then {

View File

@ -38,8 +38,7 @@ private _enemiesInVehicle = false; //Possible Side Restriction
{
if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true};
false
} count crew _vehicle;
} forEach crew _vehicle;
switch (_position) do {
case "driver" : {

View File

@ -38,8 +38,7 @@ private _stepY = 1e10;
_stepX = getNumber (_x >> "stepX");
_stepY = getNumber (_x >> "stepY");
};
false
} count configProperties [_cfgGrid, "isClass _x", false];
} forEach configProperties [_cfgGrid, "isClass _x", false];
private _letterGrid = false;

View File

@ -25,8 +25,7 @@ if (_unit isKindOf "CAManBase") then {
} else {
{
_return = _return + ({_x == _magazine} count magazines _x);
false
} count crew _unit;
} forEach crew _unit;
(getMagazineCargo _unit) params [["_magNames", []], ["_magCount", []]];
{

View File

@ -24,7 +24,6 @@ scopeName "main";
{
if (_unit == (_vehicle turretUnit _x)) then {_x breakOut "main"};
nil
} count allTurrets [_vehicle, true];
} forEach allTurrets [_vehicle, true];
[]

View File

@ -33,7 +33,6 @@ private _crew = [];
_crew pushBack (_x select 0);
};
};
false
} count fullCrew _vehicle;
} forEach fullCrew _vehicle;
_crew

View File

@ -29,7 +29,6 @@ private _modes = [];
if (_x == "this") then {
_modes pushBack _weapon;
};
false
} count getArray (_config >> "modes");
} forEach getArray (_config >> "modes");
_modes

View File

@ -42,7 +42,6 @@ private _ammo = _muzzles apply {0};
_ammo set [_index, _x select 1];
};
};
false
} count magazinesAmmoFull _unit;
} forEach magazinesAmmoFull _unit;
[_attachments, _muzzles, _magazines, _ammo];

View File

@ -28,8 +28,7 @@ if (isNil QGVAR(LSD_Vehicles)) then {
if (_hSCount > 0) then {
GVAR(LSD_Vehicles) pushBack [_x, _hSCount];
};
nil
} count _units;
} forEach _units;
if (isNil QGVAR(LSD_Colors)) then {
GVAR(LSD_Colors) = [
@ -51,8 +50,7 @@ if (isNil QGVAR(LSD_PFH)) then {
for "_i" from 0 to (_hSCount - 1) do {
_vehicle setObjectTexture [_i, GVAR(LSD_Colors) select _index];
};
nil
} count GVAR(LSD_Vehicles);
} forEach GVAR(LSD_Vehicles);
_index = ((_index + 1) % 7) mod count GVAR(LSD_Colors);
(_this select 0) set [0, _index];

View File

@ -32,8 +32,7 @@ private _whitespaceList = [];
} else {
_whitespaceList pushBack ([_x] call CBA_fnc_trim);
};
false
} count _list;
} forEach _list;
_list = _whitespaceList;
TRACE_1("Whitespace List",_list);
@ -46,8 +45,7 @@ if (_checkNil) then {
if (!isNil _x) then {
_nilCheckedList pushBack (missionNamespace getVariable _x);
};
false
} count _list;
} forEach _list;
_list = _nilCheckedList;
};

View File

@ -27,8 +27,7 @@ if (isPlayer _unit) then {
// clear all disable user input
{
[_x, false] call FUNC(setDisableUserInputStatus);
false
} count GVAR(DISABLE_USER_INPUT_COLLECTION);
} forEach GVAR(DISABLE_USER_INPUT_COLLECTION);
};
};
@ -36,5 +35,4 @@ if (isPlayer _unit) then {
if !(_x select 4) then {
_unit setVariable [_x select 0, nil, _x select 3];
};
false
} count ([_unit] call FUNC(getAllDefinedSetVariables));
} forEach ([_unit] call FUNC(getAllDefinedSetVariables));

View File

@ -24,6 +24,4 @@ _respawnVariables pushBack "ACE_PersistentFunctions";
{
_unit setVariable [_x, _unit getVariable _x, true];
false
} count _respawnVariables;
nil
} forEach _respawnVariables;

View File

@ -47,7 +47,6 @@ private _array = [];
_array pushBack _x;
};
};
false
} count toArray _string;
} forEach toArray _string;
toString _array // return

View File

@ -29,8 +29,7 @@ if (isNil QGVAR(publishSchedId)) then {
{
_x params ["_unit", "_varName"];
_unit setVariable [_varName, _unit getVariable _varName, true];
false
} count GVAR(publishVarNames);
} forEach GVAR(publishVarNames);
GVAR(publishVarNames) = [];
GVAR(publishNextTime) = 1e7;

View File

@ -22,7 +22,7 @@ params ["_wirecoil", "_unit"];
private _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0];
{
_wireNoGeo animate [_x, 1];
} count WIRE_FAST;
} forEach WIRE_FAST;
GVAR(placer) = _unit;
private _dir = getDir _unit;
@ -51,7 +51,7 @@ GVAR(deployPFH) = [{
private _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0];
{
_wire animate [_x, _anim];
} count WIRE_FAST;
} forEach WIRE_FAST;
[{
params ["_args", "_idPFH"];
@ -74,7 +74,7 @@ GVAR(deployPFH) = [{
_wireNoGeo setDir _dir;
{
_wireNoGeo animate [_x, _anim];
} count WIRE_FAST;
} forEach WIRE_FAST;
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler;
[LLSTRING(RollWire), "", ""] call EFUNC(interaction,showMouseHint);

View File

@ -20,7 +20,7 @@ params ["_wire"];
{
_wire animate [_x, 1];
} count WIRE_FAST;
} forEach WIRE_FAST;
[{
params ["_args", "_idPFH"];

View File

@ -50,7 +50,7 @@ if (!_doNotDropAmmo) then {
if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith {
_holder = _x;
};
} count ((getpos _target) nearObjects [DISARM_CONTAINER, 3]);
} forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]);
};
//Create a new weapon holder

View File

@ -93,7 +93,7 @@ GVAR(disarmTarget) = _target;
if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith {
_holder = _x;
};
} count ((getpos _target) nearObjects [DISARM_CONTAINER, 3]);
} forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]);
//If a holder exists, show it's inventory
if (!isNull _holder) then {

View File

@ -32,7 +32,7 @@ private _detonators = [_unit] call FUNC(getDetonators);
if !(_x in _detonators) exitWith {
_hasRequired = false;
};
} count _requiredItems;
} forEach _requiredItems;
private _code = "";
while {true} do {

View File

@ -31,7 +31,7 @@ private _children = [];
if !(_x in _detonators) exitWith {
_hasRequiredItems = false;
};
} count _required;
} forEach _required;
if (_hasRequiredItems && {(!_isAttached) || {(getNumber (_x >> "isAttachable")) == 1}}) then {
_children pushBack
[

View File

@ -24,7 +24,6 @@ private _explosive = [];
if ((_x select 1) == _code) exitWith {
_explosive = _x;
};
false
} count GVAR(CellphoneIEDs);
} forEach GVAR(CellphoneIEDs);
_explosive

View File

@ -34,8 +34,8 @@ private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
//Only delete the hook first so the rope falls down.
//Note: ropeDetach was used here before, but the command seems a bit broken.
deleteVehicle _hook;
[{{deleteVehicle _x} count _this}, [_ropeTop, _ropeBottom, _dummy], 60] call CBA_fnc_waitAndExecute;
} count _deployedRopes;
[{{deleteVehicle _x} forEach _this}, [_ropeTop, _ropeBottom, _dummy], 60] call CBA_fnc_waitAndExecute;
} forEach _deployedRopes;
_vehicle setVariable [QGVAR(deployedRopes), [], true];

View File

@ -67,9 +67,7 @@ if (GVAR(requireRopeItems) && {_ropeClass != ""}) then {
//deployedRopes format: attachment point, top part of the rope, bottom part of the rope, attachTo helper object, occupied, broken
_deployedRopes pushBack [_ropeOrigin, _ropeTop, _ropeBottom, _dummy, _hook, false, false];
false
} count _ropeOrigins;
} forEach _ropeOrigins;
_vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true];
_vehicle setVariable [QGVAR(deploymentStage), 3, true];

View File

@ -22,5 +22,4 @@ private _synchedUnits = synchronizedObjects _module;
_x = vehicle _x;
};
[_x] call FUNC(equipFRIES);
false
} count _synchedUnits;
} forEach _synchedUnits;

View File

@ -44,8 +44,7 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret
if (_x != "this") then {
_weaponMagazines append getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines");
};
false
} count _muzzles;
} forEach _muzzles;
// Fix the `in` operator being case sensitive and BI fucking up the spelling of their own classnames
private _weaponMagazinesCheck = _weaponMagazines apply {toLowerANSI _x};
@ -62,8 +61,7 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret
_initSpeed = _initSpeedCoef;
};
};
false
} count (_vehicle weaponsTurret _turret);
} forEach (_vehicle weaponsTurret _turret);
private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance];
_offset = parseNumber _offset;
@ -72,8 +70,7 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret
_FCSMagazines pushBack _magazine;
_FCSElevation pushBack _offset;
};
false
} count (_vehicle magazinesTurret _turret);
} forEach (_vehicle magazinesTurret _turret);
[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(InitSpeed), _turret], _FCSInitSpeed] call EFUNC(common,setVariablePublic);

View File

@ -42,7 +42,7 @@ private _sendFingerToPlayers = [];
private _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]);
{
_nearbyMen append (crew _x);
} count (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]);
} forEach (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]);
{
if ((((eyePos _x) vectorDistance _playerEyePosASL) < GVAR(maxRange)) &&
{alive _x} &&
@ -53,8 +53,7 @@ private _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]
_sendFingerToPlayers pushBack _x;
};
true
} count _nearbyMen;
} forEach _nearbyMen;
TRACE_1("sending finger to",_sendFingerToPlayers);

View File

@ -31,9 +31,7 @@ if (!hasInterface) exitWith {};
[_key, [false, (_key != -1), false]],
false
] call CBA_fnc_addKeybind;
false
} count [
} forEach [
["Freeze", 80], // Numpad 2
["Cover", 81], // Numpad 3
["Forward", 75], // Numpad 4

View File

@ -36,7 +36,6 @@ private _rotorWash = [false, 0];
_rotorWash set [1, _distance];
};
};
false
} count (position _unit nearEntities [["Helicopter"], _radius]);
} forEach (position _unit nearEntities [["Helicopter"], _radius]);
_rotorWash

View File

@ -85,7 +85,7 @@ _affected = _affected - [ACE_player];
}, [_unit]] call CBA_fnc_waitUntilAndExecute;
};
};
} count _affected;
} forEach _affected;
// Affect local player, independently of distance
if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then {

View File

@ -53,7 +53,7 @@ if (isNil "_loudness") then {
private _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines");
_weaponMagazines append _muzzleMagazines;
};
} count _muzzles;
} forEach _muzzles;
{
private _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo");
_weaponMagazines set [_forEachIndex, [_x, _ammoType]];
@ -65,7 +65,7 @@ if (isNil "_loudness") then {
if (_ammoType == _ammo) exitWith {
_magazine = _magazineType;
};
} count _weaponMagazines;
} forEach _weaponMagazines;
if (_magazine == "") then {
_loudness = 0;

View File

@ -77,8 +77,7 @@ GVAR(no_cams) sort true;
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then {
GVAR(no_cams) pushBack _x;
};
true
} count GVAR(nearHuntIRs);
} forEach GVAR(nearHuntIRs);
{
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then {
GVAR(no_cams) deleteAt _forEachIndex;

View File

@ -67,8 +67,7 @@ if (_insertChildrenCode isNotEqualTo {}) then {
if ((count _action) > 0) then {
_activeChildren pushBack _action;
};
nil
} count _dynamicChildren;
} forEach _dynamicChildren;
};
// Collect children class actions
@ -77,8 +76,7 @@ if (_insertChildrenCode isNotEqualTo {}) then {
if ((count _action) > 0) then {
_activeChildren pushBack _action;
};
nil
} count _origActionChildren;
} forEach _origActionChildren;
// Collect children object actions
{
@ -91,8 +89,7 @@ if (_insertChildrenCode isNotEqualTo {}) then {
_activeChildren pushBack _action;
};
};
nil
} count GVAR(objectActionList);
} forEach GVAR(objectActionList);
// If the original action has no statement, and no children, don't display it

View File

@ -114,8 +114,7 @@ private _recurseFnc = {
];
_actions pushBack _entry;
};
nil
} count (configProperties [_actionsCfg, "isClass _x", true]);
} forEach (configProperties [_actionsCfg, "isClass _x", true]);
_actions
};

View File

@ -84,8 +84,7 @@ private _recurseFnc = {
];
_actions pushBack _entry;
};
nil
} count (configProperties [_actionsCfg, "isClass _x", true]);
} forEach (configProperties [_actionsCfg, "isClass _x", true]);
_actions
};

View File

@ -33,7 +33,6 @@ private _actions = [];
_x params ["_actionData", "_children"];
_actions pushBack [_actionData, _children, _unit];
false
} count (_actionTrees select 0 select 1);
} forEach (_actionTrees select 0 select 1);
_actions

View File

@ -28,5 +28,4 @@ private _chance = [0.5, 0.8] select (count weapons _unit > 0);
if (count weapons _x == 0 && {random 1 < _chance}) then {
[QGVAR(getDown), [_x], [_x]] call CBA_fnc_targetEvent;
};
false
} count (_target nearEntities ["Civilian", SEND_RADIUS]);
} forEach (_target nearEntities ["Civilian", SEND_RADIUS]);

View File

@ -76,7 +76,7 @@ GVAR(usedScrollWheel) = false;
if !(GVAR(usedScrollWheel)) then {
private _phase = parseNumber (_house animationPhase (_animations select 0) < 0.5);
{_house animate [_x, _phase]; false} count _animations;
{_house animate [_x, _phase]} forEach _animations;
};
// Raise local stopped opening event
@ -93,5 +93,5 @@ GVAR(usedScrollWheel) = false;
GVAR(usedScrollWheel) = true;
};
// do incremental door opening
{_house animate [_x, GVAR(doorTargetPhase)]; false} count _animations;
{_house animate [_x, GVAR(doorTargetPhase)]} forEach _animations;
}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2, _door]] call CBA_fnc_addPerFrameHandler;

View File

@ -31,5 +31,4 @@ private _chance = [0.5, 0.8] select (count weapons _unit > 0);
[QGVAR(sendAway), [_x, _position], [_x]] call CBA_fnc_targetEvent;
};
false
} count (_unit nearEntities ["Civilian", SEND_RADIUS]);
} forEach (_unit nearEntities ["Civilian", SEND_RADIUS]);

View File

@ -73,8 +73,7 @@ GVAR(hasWatch) = true;
GVAR(hasWatch) = false;
{
if (_x isKindOf ["ItemWatch", configFile >> "CfgWeapons"]) exitWith {GVAR(hasWatch) = true;};
false
} count (assignedItems _unit);
} forEach (assignedItems _unit);
}, true] call CBA_fnc_addPlayerEventHandler;

View File

@ -49,5 +49,4 @@ TRACE_2("params",_allMapMarkers,_allMapMarkersProperties);
_x setMarkerDirLocal _dir;
_x setMarkerSizeLocal [_scale, _scale];
};
false
} count allMapMarkers;
} forEach allMapMarkers;

View File

@ -55,9 +55,7 @@ private _missionRoot = str missionConfigFile select [0, count str missionConfigF
ERROR_1("Ambient Sounds: Sound ""%1"" not found.",_x);
};
};
false
} count _splittedList;
} forEach _splittedList;
if (count _ambianceSounds == 0) exitWith {};
{

View File

@ -138,8 +138,7 @@ if (_enabledTagsNearby) then {
[ACE_player, _target, _alpha, _distance * 0.026, _drawName, _drawRank, _drawSoundwave] call FUNC(drawNameTagIcon);
};
};
nil
} count _targets;
} forEach _targets;
};
END_COUNTER(GVAR(onDraw3d));

View File

@ -44,7 +44,6 @@ if (GVAR(supply) == 2) exitWith {
{
_x params ["_magazine", "_rounds"];
if ((_magazine isEqualTo _magazineClass) && (_rounds > 0)) exitWith {_magazinePresent = true; };
false
} count _magazineSupply;
} forEach _magazineSupply;
_magazinePresent
};

View File

@ -58,8 +58,7 @@ if (GVAR(supply) == 1) then {
_numChars = _numChars max (count _line);
_text = format ["%1<br/>%2", _text, _line];
_supply = _supply + 0.5;
false
} count _magazines;
} forEach _magazines;
};
if (_supply > 1.5) then {
[[LSTRING(Hint_RemainingAmmo), _text], _supply, _unit, (_numChars/2.9)] call EFUNC(common,displayTextStructured);

View File

@ -28,8 +28,7 @@ if (isServer) then {
} else {
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _turretOwnerID] call CBA_fnc_ownerEvent;
};
false
} count _turrets;
} forEach _turrets;
} else {
[QGVAR(rearmEntireVehicleSuccessEH), _this] call CBA_fnc_serverEvent;
};

View File

@ -30,8 +30,7 @@ if (!isNull _logic) then {
// Add synchronized objects to list
{
_list pushBack _x;
nil
} count (synchronizedObjects _logic);
} forEach (synchronizedObjects _logic);
if (_list isEqualTo []) exitWith {};
@ -40,6 +39,5 @@ if (!isNull _logic) then {
// Add spare parts
{
[_x, _amount, _part, true] call FUNC(addSpareParts);
false
} count _list;
} forEach _list;
};

View File

@ -23,7 +23,6 @@ if !(_activated) exitWith {};
{
_x setVariable ["ACE_canMoveRallypoint", true];
false
} count _units;
} forEach _units;
INFO("Rallypoint Module Initialized.");

View File

@ -56,8 +56,7 @@ if (inputAction "nextWeapon" > 0) then {
if (_x == "this") then {
_modes pushBack _weapon;
};
nil
} count getArray (configFile >> "CfgWeapons" >> _weapon >> "modes");
} forEach getArray (configFile >> "CfgWeapons" >> _weapon >> "modes");
// select last mode
private _mode = _modes select (count _modes - 1);

View File

@ -34,7 +34,7 @@ _unit setVariable [QGVAR(isUsingSandbag), true];
// Force physx update
{
_x setPosASL (getPosASL _x);
} count (_unit nearObjects ["ACE_SandbagObject", 5]);
} forEach (_unit nearObjects ["ACE_SandbagObject", 5]);
[_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory);
}, [_unit, _sandbag], 1.5] call CBA_fnc_waitAndExecute;

View File

@ -34,7 +34,7 @@ private _actions = [];
(_this select 2) params ["_objects", "_image", "_currentSlideshow", "_selection"];
{
_x setObjectTextureGlobal [_selection, _image]
} count _objects;
} forEach _objects;
[QGVAR(slideChanged), [_image, _currentSlideshow]] call CBA_fnc_localEvent;
},
{true},

View File

@ -36,7 +36,7 @@ private _image = _images select _currentSlide;
// Set slide
{
_x setObjectTextureGlobal [_selection, _image];
} count _objects;
} forEach _objects;
[QGVAR(slideChanged), [_image, _currentSlideshow]] call CBA_fnc_localEvent;

View File

@ -50,7 +50,7 @@ if (isServer) then {
// Default images on whiteboards (first image)
{
_x setObjectTextureGlobal [_selection, _images select 0];
} count _objects;
} forEach _objects;
};
// Number of slideshows (multiple modules support)
@ -89,8 +89,7 @@ if (_duration == 0) then {
2
] call EFUNC(interact_menu,createAction);
[_x, 0, ["ACE_MainActions"], _slidesAction] call EFUNC(interact_menu,addActionToObject);
nil
} count _controllers;
} forEach _controllers;
} else {
if !(isServer) exitWith {};

View File

@ -37,8 +37,7 @@ private _selection = _logic getVariable ["Selection", 0];
// Objects synced to the module
{
_objects pushBack _x;
nil
} count (synchronizedObjects _logic);
} forEach (synchronizedObjects _logic);
// Prepare with actions
[_objects, _controllers, _images, _names, _duration, _setName, _selection] call FUNC(createSlideshow);

View File

@ -27,7 +27,7 @@ GVAR(AllMarkerNames) = [];
// delete markers
{
deleteMarkerLocal _x;
} count GVAR(AllMarkerNames);
} forEach GVAR(AllMarkerNames);
// reset the array
GVAR(AllMarkerNames) = [];
@ -58,8 +58,7 @@ GVAR(AllMarkerNames) = [];
};
GVAR(AllMarkerNames) pushBack _markerName;
nil
};
} count allUnits;
} forEach allUnits;
};
}, 1.5, [_sidesToShow]] call CBA_fnc_addPerFrameHandler;

View File

@ -26,7 +26,7 @@ params ["_unit", "_ladder"];
{
_ladder animate [_x, 0];
} count __ANIMS;
} forEach __ANIMS;
[_unit, "amovpercmstpslowwrfldnon_player_idlesteady03", 2] call EFUNC(common,doAnimation);
@ -35,7 +35,7 @@ _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of playe
_ladder animate ["rotate", 0];
{
_ladder animate [_x, 1];
} count ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3)
} forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3)
GVAR(ladder) = _ladder;
GVAR(cancelTime) = CBA_missionTime + 1; // Workaround to prevent accidental canceling

View File

@ -35,8 +35,7 @@ GVAR(adjustPFH) = [{
{
_tripod animate [_x, 1 - GVAR(height)];
} count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"];
} forEach ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"];
}, 0, [_unit, _tripod]] call CBA_fnc_addPerFrameHandler;
[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);

View File

@ -34,7 +34,7 @@ if (stance _unit == "STAND") then {
{
_tripod animate [_x, 0.5];
} count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"];
} forEach ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"];
[{
(_this select 0) params ["_tripod", "_direction", "_position"];

View File

@ -21,10 +21,8 @@ GVAR(GrenadesNonFrag) = [];
private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive");
([GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select (_explosive == 0)) pushBack _x;
false
} count _magazines;
false
} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
} forEach _magazines;
} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
#include "initSettings.inc.sqf"

View File

@ -37,8 +37,7 @@ private _grenades = [];
if (_x in _magazines) then {
_grenades pushBack _x;
};
false
} count ([GVAR(GrenadesAll), GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select _type);
} forEach ([GVAR(GrenadesAll), GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select _type);
// abort if no grenades are available
if (_grenades isEqualTo []) exitWith {false};

View File

@ -58,8 +58,7 @@ if (_terrainEffectEnabled) then {
if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith {
_newWindSpeed = cos(_x * 9) * _windSpeed;
};
nil
} count [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
} forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
_windSpeed = _newWindSpeed;
};
};
@ -81,8 +80,7 @@ if (_obstacleEffectEnabled) then {
if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith {
_newWindSpeed = cos(_x * 2) * _windSpeed;
};
nil
} count [0, 5, 10, 15, 20, 25, 30, 35, 40, 45];
} forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45];
_windSpeed = _newWindSpeed;
};
};