diff --git a/addons/common/init_perFrameHandler.sqf b/addons/common/init_perFrameHandler.sqf index d0b10f3f5..795211f42 100644 --- a/addons/common/init_perFrameHandler.sqf +++ b/addons/common/init_perFrameHandler.sqf @@ -34,9 +34,8 @@ GVAR(waitUntilAndExecArray) = []; if (diag_tickTime > _delta) then { _x set [2, _delta + _delay]; [_args, _handle] call _function; - false }; - } count GVAR(perFrameHandlerArray); + } forEach GVAR(perFrameHandlerArray); // Execute wait and execute functions @@ -64,8 +63,7 @@ GVAR(waitUntilAndExecArray) = []; // Execute the exec next frame functions { (_x select 0) call (_x select 1); - false - } count GVAR(nextFrameBufferA); + } forEach GVAR(nextFrameBufferA); // Swap double-buffer: GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB); GVAR(nextFrameBufferB) = []; diff --git a/addons/jr/fnc_compatibleItems.sqf b/addons/jr/fnc_compatibleItems.sqf index 7acd57d41..02ea91a53 100644 --- a/addons/jr/fnc_compatibleItems.sqf +++ b/addons/jr/fnc_compatibleItems.sqf @@ -44,20 +44,17 @@ if (isNil "_compatibleItems") then { if (isArray _cfgCompatibleItems) then { { _compatibleItems pushBackUnique _x; - nil - } count getArray _cfgCompatibleItems; + } forEach getArray _cfgCompatibleItems; } else { if (isClass _cfgCompatibleItems) then { { if (getNumber _x > 0) then { _compatibleItems pushBackUnique configName _x; }; - nil - } count configProperties [_cfgCompatibleItems, "isNumber _x"]; + } forEach configProperties [_cfgCompatibleItems, "isNumber _x"]; }; }; - nil - } count configProperties [_cfgWeapon >> "WeaponSlotsInfo", "isclass _x"]; + } forEach configProperties [_cfgWeapon >> "WeaponSlotsInfo", "isclass _x"]; GVAR(namespace) setVariable [_weapon, _compatibleItems]; //save entry in cache } else { diff --git a/addons/statemachine/fnc_clockwork.sqf b/addons/statemachine/fnc_clockwork.sqf index 97a85296f..4aa130f51 100644 --- a/addons/statemachine/fnc_clockwork.sqf +++ b/addons/statemachine/fnc_clockwork.sqf @@ -23,7 +23,6 @@ SCRIPT(clockwork); private _stateMachine = _x; private _list = _stateMachine getVariable QGVAR(list); private _skipNull = _stateMachine getVariable QGVAR(skipNull); - private _updateCode = _stateMachine getVariable QGVAR(updateCode); private _id = _stateMachine getVariable QGVAR(ID); private _tick = _stateMachine getVariable QGVAR(tick); @@ -36,6 +35,7 @@ SCRIPT(clockwork); // When the list was iterated through, jump back to start and update it if (_tick >= count _list) then { + private _updateCode = _stateMachine getVariable QGVAR(updateCode); _tick = 0; if !(_updateCode isEqualTo {}) then { _list = [] call _updateCode; @@ -102,5 +102,4 @@ SCRIPT(clockwork); (GVAR(performanceCounters) select _id) pushBack _perfRunTime; #endif - false -} count GVAR(stateMachines); +} forEach GVAR(stateMachines); diff --git a/addons/statemachine/fnc_createFromConfig.sqf b/addons/statemachine/fnc_createFromConfig.sqf index 77a7657e9..3607bb0de 100644 --- a/addons/statemachine/fnc_createFromConfig.sqf +++ b/addons/statemachine/fnc_createFromConfig.sqf @@ -37,8 +37,7 @@ private _stateMachine = [_list, _skipNull] call FUNC(create); GET_FUNCTION(_onStateLeaving,_x >> "onStateLeaving"); [_stateMachine, _onState, _onStateEntered, _onStateLeaving, _state] call FUNC(addState); - false -} count (configProperties [_config, "isClass _x", true]); +} forEach (configProperties [_config, "isClass _x", true]); // We need to add the transitions in a second loop to make sure the states exist already { @@ -59,10 +58,8 @@ private _stateMachine = [_list, _skipNull] call FUNC(create); [_stateMachine, _state, _targetState, _events, _condition, _onTransition, _transition] call FUNC(addEventTransition); }; - false - } count (configProperties [_x, "isClass _x", true]); + } forEach (configProperties [_x, "isClass _x", true]); - false -} count (configProperties [_config, "isClass _x", true]); +} forEach (configProperties [_config, "isClass _x", true]); _stateMachine diff --git a/addons/xeh/fnc_addClassEventHandler.sqf b/addons/xeh/fnc_addClassEventHandler.sqf index 58c858144..fc7d5983b 100644 --- a/addons/xeh/fnc_addClassEventHandler.sqf +++ b/addons/xeh/fnc_addClassEventHandler.sqf @@ -79,8 +79,7 @@ _entities = _entities arrayIntersect _entities; // entities can return duplicate }; }; }; - true -} count _entities; +} forEach _entities; // define for units that are created later private _events = EVENTHANDLERS(_eventName,_className); diff --git a/addons/xeh/fnc_preInit.sqf b/addons/xeh/fnc_preInit.sqf index c071f33b6..34c6628ee 100644 --- a/addons/xeh/fnc_preInit.sqf +++ b/addons/xeh/fnc_preInit.sqf @@ -63,11 +63,11 @@ GVAR(EventsLowercase) = []; FUNC(Init) = compileFinal (_header + "(_this select 0) call CBA_fnc_initEvents; (_this select 0) call CBA_fnc_init"); } else { if (_x isEqualTo "HitPart") then { - FUNC(HitPart) = compileFinal (_header + format ['{call _x; nil} count ((_this select 0 select 0) getVariable QGVAR(%1))', _x]); + FUNC(HitPart) = compileFinal (_header + format ['{call _x} forEach ((_this select 0 select 0) getVariable QGVAR(%1))', _x]); } else { missionNamespace setVariable [ format [QFUNC(%1), _x], - compileFinal (_header + format ['{call _x; nil} count ((_this select 0) getVariable QGVAR(%1))', _x]) + compileFinal (_header + format ['{call _x} forEach ((_this select 0) getVariable QGVAR(%1))', _x]) ]; }; }; diff --git a/addons/xeh/fnc_startFallbackLoop.sqf b/addons/xeh/fnc_startFallbackLoop.sqf index c48be4d6f..f8e8e5271 100644 --- a/addons/xeh/fnc_startFallbackLoop.sqf +++ b/addons/xeh/fnc_startFallbackLoop.sqf @@ -28,8 +28,7 @@ GVAR(fallbackRunning) = true; { // don't run init and initPost event handlers on objects that already exist SETINITIALIZED(_x); - true -} count (entities [[], [], true, true]); +} count (entities [[], [], true, true]); // count is safe here because SETINITIALIZED is a setVariable, which returns nil GVAR(entities) = [];