From 3d22e8cda72f56f3913b2c8f4d640d0e05920ef4 Mon Sep 17 00:00:00 2001 From: jokoho482 Date: Fri, 19 Apr 2024 18:53:42 +0200 Subject: [PATCH] Change all counts to forEach as the performance difference is negligible and can cause more issues than --- addons/CLib/3dGraphics/fn_add3dGraphics.sqf | 3 +- addons/CLib/3dGraphics/fn_draw3dGraphics.sqf | 3 +- .../fn_addASMTransition.sqf | 3 +- addons/CLib/Core/Autoload/fn_callModules.sqf | 6 ++-- addons/CLib/Core/Autoload/fn_loadModules.sqf | 3 +- .../Core/Autoload/fn_loadModulesServer.sqf | 8 ++--- .../ClientAddonModuleLoader/fn_postInit.sqf | 18 ++++------- .../Core/Compile/fn_buildDependencyGraph.sqf | 3 +- addons/CLib/Core/Compile/fn_compile.sqf | 3 +- .../CLib/Core/Compile/fn_readAllFunctions.sqf | 9 ++---- .../Core/Compression/fn_compressString.sqf | 3 +- .../Core/Compression/fn_decompressString.sqf | 3 +- .../ExtensionFramework/fn_extensionFetch.sqf | 3 +- addons/CLib/Core/Misc/fn_cachedCall.sqf | 3 +- addons/CLib/Core/Misc/fn_flatConfigPath.sqf | 3 +- addons/CLib/Core/Misc/fn_getNearUnits.sqf | 3 +- addons/CLib/Core/Misc/fn_modLoaded.sqf | 3 +- addons/CLib/Core/Misc/fn_sanitizeString.sqf | 3 +- addons/CLib/Core/Misc/fn_textTiles.sqf | 6 ++-- .../Core/MissionModuleLoader/fn_postInit.sqf | 18 ++++------- addons/CLib/Core/fn_serverInit.sqf | 20 +++++-------- addons/CLib/Events/fn_clientInit.sqf | 6 ++-- addons/CLib/Events/fn_init.sqf | 6 ++-- addons/CLib/Events/fn_localEvent.sqf | 3 +- .../CLib/GarbageCollector/fn_serverInit.sqf | 21 +++++-------- addons/CLib/Gear/Loadout/fn_applyLoadout.sqf | 15 ++++------ addons/CLib/Gear/Loadout/fn_init.sqf | 6 ++-- addons/CLib/Gear/Loadout/fn_loadLoadout.sqf | 3 +- addons/CLib/Gear/fn_restoreGear.sqf | 30 +++++++------------ addons/CLib/Hashes/fn_namespaceToHash.sqf | 3 +- addons/CLib/Hashes/fn_setHash.sqf | 3 +- addons/CLib/Interaction/fn_addAction.sqf | 6 ++-- .../CLib/Interaction/fn_canInteractWith.sqf | 3 +- .../Interaction/fn_clientInitInteraction.sqf | 3 +- .../Interaction/fn_onCursorObjectChanged.sqf | 3 +- addons/CLib/Localization/fn_client.sqf | 3 +- addons/CLib/Localization/fn_server.sqf | 12 +++----- .../MapGraphics/fn_addMapGraphicsGroup.sqf | 4 +-- .../MapGraphics/fn_buildMapGraphicsCache.sqf | 4 +-- .../CLib/MapGraphics/fn_drawMapGraphics.sqf | 3 +- .../fn_nearestMapGraphicsGroup.sqf | 6 ++-- .../fn_triggerMapGraphicsEvent.sqf | 3 +- addons/CLib/Mutex/fn_clientInit.sqf | 3 +- .../CLib/PerFrame/fn_onEachFrameHandler.sqf | 6 ++-- .../PerFrame/fn_removePerframeHandler.sqf | 3 +- .../fn_dumpPerformanceInfo.sqf | 6 ++-- .../RemoteExecution/fn_handleIncomeData.sqf | 6 ++-- addons/CLib/Settings/fn_init.sqf | 6 ++-- addons/CLib/Settings/fn_registerSettings.sqf | 9 ++---- .../CLib/Statemachine/fn_copyStatemachine.sqf | 6 ++-- .../fn_createStatemachineFromConfig.sqf | 3 +- .../StatusEffects/fn_addStatusEffectType.sqf | 2 +- 52 files changed, 110 insertions(+), 213 deletions(-) diff --git a/addons/CLib/3dGraphics/fn_add3dGraphics.sqf b/addons/CLib/3dGraphics/fn_add3dGraphics.sqf index a44d6035..48edd77a 100644 --- a/addons/CLib/3dGraphics/fn_add3dGraphics.sqf +++ b/addons/CLib/3dGraphics/fn_add3dGraphics.sqf @@ -78,8 +78,7 @@ private _completeGraphicsData = []; _completeGraphicsData pushBack [_class, _start, _end, _lineColor, _code, _customCodeArgs]; }; }; - nil -} count _graphicsData; +} forEach _graphicsData; [GVAR(3dGraphicsNamespace), _id, _completeGraphicsData] call CFUNC(setVariable); GVAR(3dGraphicsCacheBuildFlag) = GVAR(3dGraphicsCacheBuildFlag) + 1; diff --git a/addons/CLib/3dGraphics/fn_draw3dGraphics.sqf b/addons/CLib/3dGraphics/fn_draw3dGraphics.sqf index d69291a7..c9939033 100644 --- a/addons/CLib/3dGraphics/fn_draw3dGraphics.sqf +++ b/addons/CLib/3dGraphics/fn_draw3dGraphics.sqf @@ -49,7 +49,6 @@ if (GVAR(3dGraphicsCacheVersion) != GVAR(3dGraphicsCacheBuildFlag)) then { }; }; }; - nil -} count GVAR(3dGraphicsCache); +} forEach GVAR(3dGraphicsCache); RUNTIME("3dGraphics") diff --git a/addons/CLib/AdvancedStateMachine/fn_addASMTransition.sqf b/addons/CLib/AdvancedStateMachine/fn_addASMTransition.sqf index 732ecc32..74dd50f3 100644 --- a/addons/CLib/AdvancedStateMachine/fn_addASMTransition.sqf +++ b/addons/CLib/AdvancedStateMachine/fn_addASMTransition.sqf @@ -46,5 +46,4 @@ if (_sourceStateNames isEqualType "") then { } else { LOG("Invalid source state name passed to addASMTransition"); }; - nil -} count _sourceStateNames; +} forEach _sourceStateNames; diff --git a/addons/CLib/Core/Autoload/fn_callModules.sqf b/addons/CLib/Core/Autoload/fn_callModules.sqf index 7254cbec..9ae6a6bd 100644 --- a/addons/CLib/Core/Autoload/fn_callModules.sqf +++ b/addons/CLib/Core/Autoload/fn_callModules.sqf @@ -103,8 +103,7 @@ private _thread = 0 spawn { _code = missionNamespace getVariable [_code, {LOG("Code not Found")}]; }; _args call _code; - nil - } count CGVAR(entryPointQueue); + } forEach CGVAR(entryPointQueue); }, _this select 1] call CFUNC(execNextFrame); }, [_postInit, _thread]] call CFUNC(execNextFrame); @@ -123,8 +122,7 @@ if (didJIP) then { [_event, _args] call CFUNC(localEvent); }; }; - nil - } count (_this select 1); + } forEach (_this select 1); }; ["loadJIPQueue", CLib_Player] call CFUNC(serverEvent); }; diff --git a/addons/CLib/Core/Autoload/fn_loadModules.sqf b/addons/CLib/Core/Autoload/fn_loadModules.sqf index 79a7523f..70fb76f2 100644 --- a/addons/CLib/Core/Autoload/fn_loadModules.sqf +++ b/addons/CLib/Core/Autoload/fn_loadModules.sqf @@ -126,8 +126,7 @@ QGVAR(receiveFunction) addPublicVariableEventHandler { }; }; #endif - nil - } count [missionNamespace, localNamespace, uiNamespace, parsingNamespace]; + } forEach [missionNamespace, localNamespace, uiNamespace, parsingNamespace]; // Update the loading screen with the progress. _progress call BIS_fnc_progressloadingscreen; diff --git a/addons/CLib/Core/Autoload/fn_loadModulesServer.sqf b/addons/CLib/Core/Autoload/fn_loadModulesServer.sqf index 313284a3..4136bae9 100644 --- a/addons/CLib/Core/Autoload/fn_loadModulesServer.sqf +++ b/addons/CLib/Core/Autoload/fn_loadModulesServer.sqf @@ -29,14 +29,13 @@ private _fnc_addRequiredModule = { { _x call _fnc_addRequiredModule; nil - } count _dependencies; + } forEach _dependencies; }; }; { _x call _fnc_addRequiredModule; - nil -} count _this; +} forEach _this; _requiredModules = _requiredModules apply {toLower _x}; @@ -51,8 +50,7 @@ publicVariable QGVAR(LoadedModules); if (_fullFunctionModuleName in _requiredModules || _fullFunctionModName in _requiredModules) then { GVAR(requiredFunctions) pushBackUnique _x; }; - nil -} count (parsingNamespace getVariable QCGVAR(allFunctionNamesCached)); +} forEach (parsingNamespace getVariable QCGVAR(allFunctionNamesCached)); // EH for client registration. Starts transmission of function code. // required Function that the Client needed diff --git a/addons/CLib/Core/ClientAddonModuleLoader/fn_postInit.sqf b/addons/CLib/Core/ClientAddonModuleLoader/fn_postInit.sqf index 257d7716..9109d069 100644 --- a/addons/CLib/Core/ClientAddonModuleLoader/fn_postInit.sqf +++ b/addons/CLib/Core/ClientAddonModuleLoader/fn_postInit.sqf @@ -31,8 +31,7 @@ private _fnc_compileClientFunction = { { _x setVariable [_functionVarName, _fncCode]; - nil - } count [missionNamespace, uiNamespace, parsingNamespace]; + } forEach [missionNamespace, uiNamespace, parsingNamespace]; }; private _allClientModules = []; @@ -54,10 +53,8 @@ private _functionTag = getText (_config >> "tag"); DUMP("Read Client Addon Module: " + _moduleName); _allClientModules pushBackUnique _fncName; [_filePath, _fncName] call _fnc_compileClientFunction; - nil - } count configProperties [_x, "isClass _x", true]; - nil -} count configProperties [_config, "isClass _x", true]; + } forEach configProperties [_x, "isClass _x", true]; +} forEach configProperties [_config, "isClass _x", true]; private _init = []; private _serverInit = []; @@ -86,8 +83,7 @@ private _hcInit = []; }; }; DUMP("Read Client Addon Function: " + _x); - nil -} count _allClientModules; +} forEach _allClientModules; { if (_x select 1) then { @@ -97,8 +93,6 @@ private _hcInit = []; _time = diag_tickTime - _time; private _strTime = (_time * 1000) call CFUNC(toFixedNumber); LOG("Client Addon Module Call: " + _x + " (" + _strTime + " ms)"); - nil - } count (_x select 0); + } forEach (_x select 0); }; - nil -} count [[_init, true], [_serverInit, isServer], [_clientInit, hasInterface], [_hcInit, !hasInterface && !isServer]]; +} forEach [[_init, true], [_serverInit, isServer], [_clientInit, hasInterface], [_hcInit, !hasInterface && !isServer]]; diff --git a/addons/CLib/Core/Compile/fn_buildDependencyGraph.sqf b/addons/CLib/Core/Compile/fn_buildDependencyGraph.sqf index 1209deb9..bfdefef7 100644 --- a/addons/CLib/Core/Compile/fn_buildDependencyGraph.sqf +++ b/addons/CLib/Core/Compile/fn_buildDependencyGraph.sqf @@ -39,8 +39,7 @@ while {_modulesToSort isNotEqualTo []} do { }; }; if (!_dependenciesLoaded) exitWith {}; - nil - } count _dependencies; + } forEach _dependencies; if (_dependenciesLoaded) then { _sortedModuleNames pushBack _moduleName; diff --git a/addons/CLib/Core/Compile/fn_compile.sqf b/addons/CLib/Core/Compile/fn_compile.sqf index 38836850..af8e4b68 100644 --- a/addons/CLib/Core/Compile/fn_compile.sqf +++ b/addons/CLib/Core/Compile/fn_compile.sqf @@ -59,8 +59,7 @@ scopeName (_fnc_scriptName + '_Main'); LOG("Error: " + _functionName + " could not get overwritten but is different from the current version!"); }; }; - nil -} count [missionNamespace, uiNamespace, parsingNamespace]; +} forEach [missionNamespace, uiNamespace, parsingNamespace]; #ifdef DISABLECOMPRESSION if (true) exitWith {}; diff --git a/addons/CLib/Core/Compile/fn_readAllFunctions.sqf b/addons/CLib/Core/Compile/fn_readAllFunctions.sqf index de6ce9f0..408c8714 100644 --- a/addons/CLib/Core/Compile/fn_readAllFunctions.sqf +++ b/addons/CLib/Core/Compile/fn_readAllFunctions.sqf @@ -24,8 +24,7 @@ private _fnc_readSubModule = { private _modulePath = +_modulePath; _modulePath pushBack _subModuleName; [_modPath, _modName, _moduleName, _modulePath, _x] call _fnc_checkNext; - nil - } count _children; + } forEach _children; }; private _fnc_readFunction = { @@ -65,10 +64,8 @@ DUMP("--------------------------Start CLib Function Search---------------------- { [_modPath, _modName, _moduleName, [_moduleName], _x] call _fnc_checkNext; - nil - } count (configProperties [configFile >> "CfgCLibModules" >> _modName >> _moduleName, "isClass _x", true]); + } forEach (configProperties [configFile >> "CfgCLibModules" >> _modName >> _moduleName, "isClass _x", true]); - nil -} count (parsingNamespace getVariable QGVAR(allModuleNamesCached)); +} forEach (parsingNamespace getVariable QGVAR(allModuleNamesCached)); parsingNamespace setVariable [QCGVAR(allFunctionNamesCached), GVAR(allFunctionNamesCached)]; DUMP("--------------------------End CLib Function Search---------------------------------"); diff --git a/addons/CLib/Core/Compression/fn_compressString.sqf b/addons/CLib/Core/Compression/fn_compressString.sqf index 09903958..b18b4866 100644 --- a/addons/CLib/Core/Compression/fn_compressString.sqf +++ b/addons/CLib/Core/Compression/fn_compressString.sqf @@ -89,8 +89,7 @@ _rawOutput append (_rawInput select [0, MINMATCHLENGTH]); }; if (_inputPosition == _inputLength) exitWith {}; - nil -} count _rawInput; +} forEach _rawInput; if (_writeCache isNotEqualTo []) then { _rawOutput pushBack _encodeFlag; diff --git a/addons/CLib/Core/Compression/fn_decompressString.sqf b/addons/CLib/Core/Compression/fn_decompressString.sqf index 85fe489a..62cd8ed7 100644 --- a/addons/CLib/Core/Compression/fn_decompressString.sqf +++ b/addons/CLib/Core/Compression/fn_decompressString.sqf @@ -62,7 +62,6 @@ private _inputPosition = MINMATCHLENGTH; }; if (_inputPosition == _inputLength) exitWith {}; - nil -} count _rawInput; +} forEach _rawInput; toString _rawOutput diff --git a/addons/CLib/Core/ExtensionFramework/fn_extensionFetch.sqf b/addons/CLib/Core/ExtensionFramework/fn_extensionFetch.sqf index 506303d9..47d5f8c9 100644 --- a/addons/CLib/Core/ExtensionFramework/fn_extensionFetch.sqf +++ b/addons/CLib/Core/ExtensionFramework/fn_extensionFetch.sqf @@ -42,6 +42,5 @@ if (_result select [0, 1] == GVAR(SOH)) exitWith { [QGVAR(extensionResult), _sender, [_senderId, _result]] call CFUNC(targetEvent); GVAR(pendingTasks) = GVAR(pendingTasks) - 1; - nil - } count _results; + } forEach _results; }; diff --git a/addons/CLib/Core/Misc/fn_cachedCall.sqf b/addons/CLib/Core/Misc/fn_cachedCall.sqf index a863906f..a802457d 100644 --- a/addons/CLib/Core/Misc/fn_cachedCall.sqf +++ b/addons/CLib/Core/Misc/fn_cachedCall.sqf @@ -51,8 +51,7 @@ if (_timestamp < time) then { // Erase all the cached results { GVAR(cachedCall) setVariable [_x, nil]; - nil - } count _cacheList; + } forEach _cacheList; // Empty the list GVAR(cachedCall) setVariable [_varName, []]; }] call CFUNC(addEventhandler); diff --git a/addons/CLib/Core/Misc/fn_flatConfigPath.sqf b/addons/CLib/Core/Misc/fn_flatConfigPath.sqf index 649ab91e..04de1140 100644 --- a/addons/CLib/Core/Misc/fn_flatConfigPath.sqf +++ b/addons/CLib/Core/Misc/fn_flatConfigPath.sqf @@ -40,7 +40,6 @@ private _hierarchy = configHierarchy (_configPath); }; }; _return pushBack _name; - nil -} count _hierarchy; +} forEach _hierarchy; _return joinString _separator; diff --git a/addons/CLib/Core/Misc/fn_getNearUnits.sqf b/addons/CLib/Core/Misc/fn_getNearUnits.sqf index 6b8b71d2..ae4519cd 100644 --- a/addons/CLib/Core/Misc/fn_getNearUnits.sqf +++ b/addons/CLib/Core/Misc/fn_getNearUnits.sqf @@ -41,8 +41,7 @@ params [ { _return append (crew _x); - nil - } count _vehicles; + } forEach _vehicles; [_return, CLib_Player] call CFUNC(deleteAtEntry); diff --git a/addons/CLib/Core/Misc/fn_modLoaded.sqf b/addons/CLib/Core/Misc/fn_modLoaded.sqf index cf158c22..f4b5b43e 100644 --- a/addons/CLib/Core/Misc/fn_modLoaded.sqf +++ b/addons/CLib/Core/Misc/fn_modLoaded.sqf @@ -21,6 +21,5 @@ params [ private _loadedMods = []; { _loadedMods pushbackUnique ((_x splitString "/\") select 0); - nil -} count GVAR(LoadedModules); +} forEach GVAR(LoadedModules); (toLower _mod) in _loadedMods; diff --git a/addons/CLib/Core/Misc/fn_sanitizeString.sqf b/addons/CLib/Core/Misc/fn_sanitizeString.sqf index 72dca9de..295a3e29 100644 --- a/addons/CLib/Core/Misc/fn_sanitizeString.sqf +++ b/addons/CLib/Core/Misc/fn_sanitizeString.sqf @@ -25,7 +25,6 @@ private _symbols = toArray "\/*""?<>|:"; if !(_x in _symbols) then { _array pushBack _x; }; - nil -} count (toArray _string); +} forEach (toArray _string); toString _array diff --git a/addons/CLib/Core/Misc/fn_textTiles.sqf b/addons/CLib/Core/Misc/fn_textTiles.sqf index 22e9a33f..5f5c7a08 100644 --- a/addons/CLib/Core/Misc/fn_textTiles.sqf +++ b/addons/CLib/Core/Misc/fn_textTiles.sqf @@ -124,8 +124,7 @@ private _contentIsStructuredText = _content isEqualType (parseText ""); ]; _groupContent ctrlSetFade 0; _groupContent ctrlCommit (random _fadeIn); - nil -} count _grids; +} forEach _grids; [{ params ["_grids", "_contentIsStructuredText", "_sizeW", "_sizeH", "_posW", "_posH", "_fadeOut", "_onFadeOut"]; @@ -146,8 +145,7 @@ private _contentIsStructuredText = _content isEqualType (parseText ""); ]; _groupContent ctrlSetFade 1; _groupContent ctrlCommit (random _fadeOut); - nil - } count _grids; + } forEach _grids; [{ private _display = uiNamespace getVariable "RscTilesGroup"; _display closeDisplay 0; diff --git a/addons/CLib/Core/MissionModuleLoader/fn_postInit.sqf b/addons/CLib/Core/MissionModuleLoader/fn_postInit.sqf index 556d0821..71842c38 100644 --- a/addons/CLib/Core/MissionModuleLoader/fn_postInit.sqf +++ b/addons/CLib/Core/MissionModuleLoader/fn_postInit.sqf @@ -31,8 +31,7 @@ private _fnc_compileMissionFunction = { { _x setVariable [_functionVarName, _fncCode]; - nil - } count [missionNamespace, uiNamespace, parsingNamespace]; + } forEach [missionNamespace, uiNamespace, parsingNamespace]; }; private _allMissionModules = []; @@ -53,10 +52,8 @@ private _functionTag = getText (_config >> "tag"); DUMP("Read Mission Module: " + _moduleName); _allMissionModules pushBackUnique _fncName; [_filePath, _fncName] call _fnc_compileMissionFunction; - nil - } count configProperties [_x, "isClass _x", true]; - nil -} count configProperties [_config, "isClass _x", true]; + } forEach configProperties [_x, "isClass _x", true]; +} forEach configProperties [_config, "isClass _x", true]; private _init = []; private _serverInit = []; @@ -85,8 +82,7 @@ private _hcInit = []; }; }; DUMP("Read Mission Function: " + _x); - nil -} count _allMissionModules; +} forEach _allMissionModules; { if (_x select 1) then { @@ -96,8 +92,6 @@ private _hcInit = []; _time = diag_tickTime - _time; private _strTime = (_time * 1000) call CFUNC(toFixedNumber); LOG("Mission Module Call: " + _x + " (" + _strTime + " ms)"); - nil - } count (_x select 0); + } forEach (_x select 0); }; - nil -} count [[_init, true], [_serverInit, isServer], [_clientInit, hasInterface], [_hcInit, !hasInterface && !isServer]]; +} forEach [[_init, true], [_serverInit, isServer], [_clientInit, hasInterface], [_hcInit, !hasInterface && !isServer]]; diff --git a/addons/CLib/Core/fn_serverInit.sqf b/addons/CLib/Core/fn_serverInit.sqf index 4642f9c0..20cb89eb 100644 --- a/addons/CLib/Core/fn_serverInit.sqf +++ b/addons/CLib/Core/fn_serverInit.sqf @@ -35,15 +35,13 @@ private _fnc_readAuthorData = { _version = str (getNumber (_configPath >> "version")); }; _modCredits pushBackUnique [_name, _author, _authors, _url, _version]; - nil - } count configSourceAddonList _this; + } forEach configSourceAddonList _this; }; private _modClassNames = []; { _x call _fnc_readAuthorData; _modClassNames pushBackUnique (configName _x); - nil -} count configProperties [configFile >> "CfgCLibModules", "isClass _x", true]; +} forEach configProperties [configFile >> "CfgCLibModules", "isClass _x", true]; (configFile >> "CfgCLibModules") call _fnc_readAuthorData; @@ -65,13 +63,11 @@ private _fnc_addModules = { if (_module == "") then { { [_mod, configName _x] call _fnc_addModules; - nil - } count configProperties [(configFile >> "CfgCLibModules" >> _mod), "isClass _x", true]; + } forEach configProperties [(configFile >> "CfgCLibModules" >> _mod), "isClass _x", true]; } else { [_mod, _module] call _fnc_addModules; }; - nil -} count GVAR(LoadedModules); +} forEach GVAR(LoadedModules); GVAR(textModules) = "Loaded Modules:
"; { @@ -84,8 +80,7 @@ GVAR(textModules) = "Loaded Modules:
"; GVAR(textModules) = GVAR(textModules) + format ["
%1", _name]; { GVAR(textModules) = GVAR(textModules) + format ["
- %1", _x]; - nil - } count (_modules select _forEachIndex); + } forEach (_modules select _forEachIndex); GVAR(textModules) = GVAR(textModules) + "
"; } forEach _mods; @@ -95,14 +90,13 @@ GVAR(textMods) = "Loaded Mods:
"; private _authors = ""; { _authors = _authors + format ["%1, ", _x]; - nil - } count _authorsArr; + } forEach _authorsArr; if (_authors == _author) then { GVAR(textMods) = GVAR(textMods) + format ["
%1 by %2 Version: %5
", _name, _author, _url, _version]; } else { GVAR(textMods) = GVAR(textMods) + format ["
%1 by %2: %3 Version: %5
", _name, _author, _authors select [0, (count _authors) - 2], _url, _version]; }; -} count _modCredits; +} forEach _modCredits; publicVariable QGVAR(textMods); publicVariable QGVAR(textModules); diff --git a/addons/CLib/Events/fn_clientInit.sqf b/addons/CLib/Events/fn_clientInit.sqf index c44f7f68..b0d176b2 100644 --- a/addons/CLib/Events/fn_clientInit.sqf +++ b/addons/CLib/Events/fn_clientInit.sqf @@ -46,8 +46,7 @@ private _codeStr = "private ['_oldValue', '_currentValue'];"; private _varName = format [QGVAR(EventData_%1), _name]; GVAR(EventNamespace) setVariable [_varName, call _code]; _codeStr = _codeStr + format ["_oldValue = %4 getVariable '%2'; _currentValue = call %1; if (_oldValue isNotEqualTo _currentValue) then { ['%5Changed', [_currentValue, _oldValue]] call %3; _oldValue = %4 setVariable ['%2', _currentValue]; };", _code, _varName, QCFUNC(localEvent), QGVAR(EventNamespace), _name]; - nil -} count [ +} forEach [ ["player", {missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player]}], ["currentThrowable", {currentThrowable CLib_Player}], ["currentWeapon", {currentWeapon CLib_Player}], @@ -102,8 +101,7 @@ addMissionEventHandler ["Map", { // Bind a new one and update the index in the params. _params set [2, _currentPlayer addEventHandler [_name, _code]]; }, [_x, _code, _index]] call CFUNC(addEventHandler); - nil -} count [ +} forEach [ "InventoryOpened", "Killed", "Respawn", diff --git a/addons/CLib/Events/fn_init.sqf b/addons/CLib/Events/fn_init.sqf index 789d1a97..54899325 100644 --- a/addons/CLib/Events/fn_init.sqf +++ b/addons/CLib/Events/fn_init.sqf @@ -23,8 +23,7 @@ GVAR(ignoredLogEventNames_1) = []; { _x call CFUNC(addIgnoredEventLog); - nil -} count [ +} forEach [ ["drawmapgraphics", 0], ["eventadded", 1], ["cursortargetchanged", 1], @@ -48,8 +47,7 @@ GVAR(ignoredLogEventNames_1) = []; }; { [_x, _args] call _function; - nil - } count GVAR(entitiesCached); + } forEach GVAR(entitiesCached); }; }; diff --git a/addons/CLib/Events/fn_localEvent.sqf b/addons/CLib/Events/fn_localEvent.sqf index 3d61dcaa..941b6cf3 100644 --- a/addons/CLib/Events/fn_localEvent.sqf +++ b/addons/CLib/Events/fn_localEvent.sqf @@ -38,8 +38,7 @@ if !(isNil "_eventArray") then { }; [_args, _data] call _eventFunctions; }; - nil - } count _eventArray; + } forEach _eventArray; }; #ifdef ISDEV diff --git a/addons/CLib/GarbageCollector/fn_serverInit.sqf b/addons/CLib/GarbageCollector/fn_serverInit.sqf index dea6a7a9..a7a5b2bb 100644 --- a/addons/CLib/GarbageCollector/fn_serverInit.sqf +++ b/addons/CLib/GarbageCollector/fn_serverInit.sqf @@ -89,42 +89,36 @@ GVAR(statemachine) = call CFUNC(createStatemachine); { // If the shell is not queued yet push it on the storage. _x call FUNC(pushbackInQueue); - nil - } count ((getPos _x) nearObjects ["GrenadeHand", 100]); - nil - } count allUnits; + } forEach ((getPos _x) nearObjects ["GrenadeHand", 100]); + } forEach allUnits; "fillWeaponHolder" }] call CFUNC(addStatemachineState); [GVAR(statemachine), "fillWeaponHolder", { { _x call FUNC(pushbackInQueue); - nil - } count (allMissionObjects "WeaponHolder"); + } forEach (allMissionObjects "WeaponHolder"); "fillGroundWeaponHolder" }] call CFUNC(addStatemachineState); [GVAR(statemachine), "fillGroundWeaponHolder", { { _x call FUNC(pushbackInQueue); - nil - } count (allMissionObjects "GroundWeaponHolder"); + } forEach (allMissionObjects "GroundWeaponHolder"); "fillWeaponHolderSimulated" }] call CFUNC(addStatemachineState); [GVAR(statemachine), "fillWeaponHolderSimulated", { { _x call FUNC(pushbackInQueue); - nil - } count (allMissionObjects "WeaponHolderSimulated"); + } forEach (allMissionObjects "WeaponHolderSimulated"); "fillDeadUnits" }] call CFUNC(addStatemachineState); [GVAR(statemachine), "fillDeadUnits", { { _x call FUNC(pushbackInQueue); - nil - } count allDead; + } forEach allDead; "checkGroups" }] call CFUNC(addStatemachineState); @@ -136,8 +130,7 @@ GVAR(statemachine) = call CFUNC(createStatemachine); ["deleteGroup", groupOwner _x, _x] call CFUNC(targetEvent); }; }; - nil - } count allGroups; + } forEach allGroups; "wait" }] call CFUNC(addStatemachineState); diff --git a/addons/CLib/Gear/Loadout/fn_applyLoadout.sqf b/addons/CLib/Gear/Loadout/fn_applyLoadout.sqf index 73dc9b3a..a4b6c3f2 100644 --- a/addons/CLib/Gear/Loadout/fn_applyLoadout.sqf +++ b/addons/CLib/Gear/Loadout/fn_applyLoadout.sqf @@ -51,8 +51,7 @@ private _fnc_do = { if (_items isEqualType []) then { { _x call _do; - nil - } count _items; + } forEach _items; } else { _items call _do; }; @@ -105,26 +104,22 @@ private _fnc_do = { // Weapons { [_x, {_unit addWeapon _this}, false] call _fnc_do; - nil -} count ["primaryWeapon", "secondaryWeapon", "handgun", "binocular"]; +} forEach ["primaryWeapon", "secondaryWeapon", "handgun", "binocular"]; // Primary Weapon Items { [_x, {_unit addPrimaryWeaponItem _this}, false] call _fnc_do; - nil -} count ["primaryWeaponOptic", "primaryWeaponMuzzle", "primaryWeaponBarrel", "primaryWeaponResting", "primaryWeaponLoadedMagazine"]; +} forEach ["primaryWeaponOptic", "primaryWeaponMuzzle", "primaryWeaponBarrel", "primaryWeaponResting", "primaryWeaponLoadedMagazine"]; // Secondary Weapon Items { [_x, {_unit addSecondaryWeaponItem _this}, false] call _fnc_do; - nil -} count ["secondaryWeaponOptic", "secondaryWeaponMuzzle", "secondaryWeaponBarrel", "secondaryWeaponResting", "secondaryWeaponLoadedMagazine"]; +} forEach ["secondaryWeaponOptic", "secondaryWeaponMuzzle", "secondaryWeaponBarrel", "secondaryWeaponResting", "secondaryWeaponLoadedMagazine"]; // Handgun Items { [_x, {_unit addHandgunItem _this}, false] call _fnc_do; - nil -} count ["handgunOptic", "handgunMuzzle", "handgunBarrel", "handgunResting", "handgunLoadedMagazine"]; +} forEach ["handgunOptic", "handgunMuzzle", "handgunBarrel", "handgunResting", "handgunLoadedMagazine"]; // Items to Uniform ["itemsUniform", { diff --git a/addons/CLib/Gear/Loadout/fn_init.sqf b/addons/CLib/Gear/Loadout/fn_init.sqf index a1e278a9..99987bfa 100644 --- a/addons/CLib/Gear/Loadout/fn_init.sqf +++ b/addons/CLib/Gear/Loadout/fn_init.sqf @@ -27,10 +27,8 @@ if (isServer) then { { { (configName _x) call CFUNC(loadLoadout); - nil - } count configProperties [_x >> "CfgCLibLoadouts", "isClass _x", true]; - nil - } count [missionConfigFile >> "CLib", configFile]; + } forEach configProperties [_x >> "CfgCLibLoadouts", "isClass _x", true]; + } forEach [missionConfigFile >> "CLib", configFile]; GVAR(loadoutsLoaded) = true; }, { !isNil QGVAR(defaultLoadoutValues) && !isNil QGVAR(loadoutsNamespace) diff --git a/addons/CLib/Gear/Loadout/fn_loadLoadout.sqf b/addons/CLib/Gear/Loadout/fn_loadLoadout.sqf index fdf3d9f3..7ba39b12 100644 --- a/addons/CLib/Gear/Loadout/fn_loadLoadout.sqf +++ b/addons/CLib/Gear/Loadout/fn_loadLoadout.sqf @@ -84,8 +84,7 @@ private _fnc_readClass = { params ["_config"]; { _x call ([_fnc_readData, _fnc_readClass] select (isClass _x)); - nil - } count configProperties [_config, "true", true]; + } forEach configProperties [_config, "true", true]; }; _cfg call _fnc_readClass; diff --git a/addons/CLib/Gear/fn_restoreGear.sqf b/addons/CLib/Gear/fn_restoreGear.sqf index c72adcdb..e77ac5e7 100644 --- a/addons/CLib/Gear/fn_restoreGear.sqf +++ b/addons/CLib/Gear/fn_restoreGear.sqf @@ -58,15 +58,13 @@ _assignedItems = _assignedItems - [_binocular]; if (_isLoaded && _type > 0) then { _unit addMagazine [_magazine, _count]; }; - nil -} count _magazinesAmmoFull; +} forEach _magazinesAmmoFull; { if (_x != "") then { _unit addWeapon _x; }; - nil -} count [_primaryWeapon, _secondaryWeapon, _handgun, _binocular]; +} forEach [_primaryWeapon, _secondaryWeapon, _handgun, _binocular]; { _x params ["_magazine", "_count", "_isLoaded", "", "_location"]; @@ -98,38 +96,30 @@ _assignedItems = _assignedItems - [_binocular]; _container addMagazineAmmoCargo [_magazine, 1, _count]; }; }; - nil -} count _magazinesAmmoFull; +} forEach _magazinesAmmoFull; { _unit addItemToUniform _x; - nil -} count _uniformItems; +} forEach _uniformItems; { _unit addItemToVest _x; - nil -} count _vestItems; +} forEach _vestItems; { _unit addItemToBackpack _x; - nil -} count _backpackItems; +} forEach _backpackItems; { _unit linkItem _x; - nil -} count _assignedItems; +} forEach _assignedItems; { _unit addPrimaryWeaponItem _x; - nil -} count _primaryWeaponItems; +} forEach _primaryWeaponItems; { _unit addHandgunItem _x; - nil -} count _handgunItems; +} forEach _handgunItems; { _unit addSecondaryWeaponItem _x; - nil -} count _secondaryWeaponItems; +} forEach _secondaryWeaponItems; diff --git a/addons/CLib/Hashes/fn_namespaceToHash.sqf b/addons/CLib/Hashes/fn_namespaceToHash.sqf index 5b204860..0302c58b 100644 --- a/addons/CLib/Hashes/fn_namespaceToHash.sqf +++ b/addons/CLib/Hashes/fn_namespaceToHash.sqf @@ -33,7 +33,6 @@ private _allVar = if (_allVarName == "") then { if !(isNil "_var") then { [_hashSet, _x, _var] call CFUNC(setHash); }; - nil -} count _allVar; +} forEach _allVar; _hashSet diff --git a/addons/CLib/Hashes/fn_setHash.sqf b/addons/CLib/Hashes/fn_setHash.sqf index f65abb7f..aa8591d1 100644 --- a/addons/CLib/Hashes/fn_setHash.sqf +++ b/addons/CLib/Hashes/fn_setHash.sqf @@ -31,8 +31,7 @@ switch (true) do { private _i = (_hashSet select HASH_KEYS) find _key; { _x deleteAt _i; - nil - } count _hashSet; + } forEach _hashSet; _hashSet }; case (_contain && !_delete): { diff --git a/addons/CLib/Interaction/fn_addAction.sqf b/addons/CLib/Interaction/fn_addAction.sqf index bd4f3aef..556d08c5 100644 --- a/addons/CLib/Interaction/fn_addAction.sqf +++ b/addons/CLib/Interaction/fn_addAction.sqf @@ -136,8 +136,7 @@ private _argName = ""; }; _argName = ""; }; - nil -} count _dynamicArguments; +} forEach _dynamicArguments; GVAR(currentActionID) = GVAR(currentActionID) + 1; // Convert Condition to String @@ -156,8 +155,7 @@ if (_target isEqualType "") then {_target = [_target]}; if (_target isEqualType []) then { { GVAR(Interaction_Actions) pushBackUnique [_x, _text, _condition, _callback, _args, _priority, _showWindow, _hideOnUse, _shortcut, _radius, _unconscious, _selection, _memorypoint, _onActionAdded, GVAR(currentActionID)]; - false - } count _target; + } forEach _target; }; if (_target isEqualType objNull) then { diff --git a/addons/CLib/Interaction/fn_canInteractWith.sqf b/addons/CLib/Interaction/fn_canInteractWith.sqf index 199a7d34..e9f44331 100644 --- a/addons/CLib/Interaction/fn_canInteractWith.sqf +++ b/addons/CLib/Interaction/fn_canInteractWith.sqf @@ -39,7 +39,6 @@ params [ false breakOut "canInteractWithScope"; }; }; - nil - } count GVAR(canInteractWithTypes); + } forEach GVAR(canInteractWithTypes); true }, _this, 1, QGVAR(clearCanInteractWith)] call CFUNC(cachedCall); diff --git a/addons/CLib/Interaction/fn_clientInitInteraction.sqf b/addons/CLib/Interaction/fn_clientInitInteraction.sqf index 972005e1..92feb7c7 100644 --- a/addons/CLib/Interaction/fn_clientInitInteraction.sqf +++ b/addons/CLib/Interaction/fn_clientInitInteraction.sqf @@ -32,8 +32,7 @@ GVAR(PlayerInteraction_Actions) = []; [_id, _currentPlayer, _argArray] call _onActionAdded; _x set [0, _id]; DUMP("add Real Action to Object Player " + str _text); - nil - } count GVAR(PlayerInteraction_Actions); + } forEach GVAR(PlayerInteraction_Actions); }] call CFUNC(addEventhandler); // fix issue that Action dont get readded after setRespawnTime respawn, because Variables get copyed from the old Unit via Engine command diff --git a/addons/CLib/Interaction/fn_onCursorObjectChanged.sqf b/addons/CLib/Interaction/fn_onCursorObjectChanged.sqf index 290d4253..670fcf80 100644 --- a/addons/CLib/Interaction/fn_onCursorObjectChanged.sqf +++ b/addons/CLib/Interaction/fn_onCursorObjectChanged.sqf @@ -51,7 +51,6 @@ if (_currentID isEqualTo GVAR(currentActionID)) exitWith {}; }; }; }; - nil -} count GVAR(Interaction_Actions); +} forEach GVAR(Interaction_Actions); _target setVariable [QGVAR(ActionIDs), _actionIDs]; diff --git a/addons/CLib/Localization/fn_client.sqf b/addons/CLib/Localization/fn_client.sqf index 4fef2418..10eb4278 100644 --- a/addons/CLib/Localization/fn_client.sqf +++ b/addons/CLib/Localization/fn_client.sqf @@ -27,5 +27,4 @@ if (_index == -1) then { }; DUMP("L10N Varfound: " + str _x + " Content: " + str _var); GVAR(Namespace) setVariable [_x, _var]; - nil -} count ([GVAR(Namespace), QGVAR(allLocalizations)] call CFUNC(allVariables)); +} forEach ([GVAR(Namespace), QGVAR(allLocalizations)] call CFUNC(allVariables)); diff --git a/addons/CLib/Localization/fn_server.sqf b/addons/CLib/Localization/fn_server.sqf index ad62f995..d2b23231 100644 --- a/addons/CLib/Localization/fn_server.sqf +++ b/addons/CLib/Localization/fn_server.sqf @@ -41,8 +41,7 @@ private _fnc_readLocalization = { params ["_config", "_name"]; { [_name, configName _x, getText _x] call _fnc_setLanguageKey; - nil - } count configProperties [_config, "isText _x", true]; + } forEach configProperties [_config, "isText _x", true]; }; private _fnc_readLocalizationClass = { @@ -53,18 +52,15 @@ private _fnc_readLocalizationClass = { } else { { [_x, _name + "_" + configName _x] call _fnc_readLocalizationClass; - nil - } count _childs; + } forEach _childs; }; }; { { [_x, configName _x] call _fnc_readLocalizationClass; - nil - } count configProperties [_x >> "CfgCLibLocalization", "isClass _x", true]; - nil -} count [campaignConfigFile, missionConfigFile >> "CLib", configFile]; + } forEach configProperties [_x >> "CfgCLibLocalization", "isClass _x", true]; +} forEach [campaignConfigFile, missionConfigFile >> "CLib", configFile]; publicVariable QGVAR(Namespace); publicVariable QGVAR(supportedLanguages); diff --git a/addons/CLib/MapGraphics/fn_addMapGraphicsGroup.sqf b/addons/CLib/MapGraphics/fn_addMapGraphicsGroup.sqf index 3a59add6..639909b5 100644 --- a/addons/CLib/MapGraphics/fn_addMapGraphicsGroup.sqf +++ b/addons/CLib/MapGraphics/fn_addMapGraphicsGroup.sqf @@ -163,9 +163,7 @@ private _completeGroupData = []; _completeGroupData pushBack [_class, _tris, _lineColor, _fillColor, _code, _customCodeArgs]; }; }; - - nil -} count _groupData; +} forEach _groupData; // select the correct state private _stateNum = 0 max (["normal", "hover", "selected"] find _state); diff --git a/addons/CLib/MapGraphics/fn_buildMapGraphicsCache.sqf b/addons/CLib/MapGraphics/fn_buildMapGraphicsCache.sqf index b9449b85..07623127 100644 --- a/addons/CLib/MapGraphics/fn_buildMapGraphicsCache.sqf +++ b/addons/CLib/MapGraphics/fn_buildMapGraphicsCache.sqf @@ -37,9 +37,7 @@ private _cache = []; }; _cache append _cData; }; - - nil; -} count ([GVAR(MapGraphicsGroup)] call CFUNC(allVariables)); +} forEach GVAR(MapGraphicsGroup); _cache sort true; diff --git a/addons/CLib/MapGraphics/fn_drawMapGraphics.sqf b/addons/CLib/MapGraphics/fn_drawMapGraphics.sqf index f4038d90..58fdfa8b 100644 --- a/addons/CLib/MapGraphics/fn_drawMapGraphics.sqf +++ b/addons/CLib/MapGraphics/fn_drawMapGraphics.sqf @@ -126,8 +126,7 @@ if (GVAR(MapGraphicsCacheVersion) != GVAR(MapGraphicsCacheBuildFlag)) then { _cache pushBack [_groupId, _positions, nil, nil, nil, false, true]; }; }; - nil -} count GVAR(MapGraphicsCache); +} forEach GVAR(MapGraphicsCache); GVAR(MapGraphicsGeometryCache) = _cache; RUNTIME("DrawMapIcons"); diff --git a/addons/CLib/MapGraphics/fn_nearestMapGraphicsGroup.sqf b/addons/CLib/MapGraphics/fn_nearestMapGraphicsGroup.sqf index 32b47821..01ef1192 100644 --- a/addons/CLib/MapGraphics/fn_nearestMapGraphicsGroup.sqf +++ b/addons/CLib/MapGraphics/fn_nearestMapGraphicsGroup.sqf @@ -43,8 +43,7 @@ private _nearestIcon = ""; _nearestIcon = _iconId; _r = _temp1; }; - nil - } count _pos; + } forEach _pos; private _temp1 = _centerPos distance2D _mousePosition; if (_temp1 < _r) then { @@ -61,7 +60,6 @@ private _nearestIcon = ""; }; }; }; - nil; -} count GVAR(MapGraphicsGeometryCache); +} forEach GVAR(MapGraphicsGeometryCache); _nearestIcon; diff --git a/addons/CLib/MapGraphics/fn_triggerMapGraphicsEvent.sqf b/addons/CLib/MapGraphics/fn_triggerMapGraphicsEvent.sqf index 52f704bc..f15fcb8a 100644 --- a/addons/CLib/MapGraphics/fn_triggerMapGraphicsEvent.sqf +++ b/addons/CLib/MapGraphics/fn_triggerMapGraphicsEvent.sqf @@ -39,6 +39,5 @@ if (isNil "_eventArray") exitWith {}; }; [_args, _data] call _code; }; - nil -} count _eventArray; +} forEach _eventArray; nil diff --git a/addons/CLib/Mutex/fn_clientInit.sqf b/addons/CLib/Mutex/fn_clientInit.sqf index 31143ef7..a914027a 100644 --- a/addons/CLib/Mutex/fn_clientInit.sqf +++ b/addons/CLib/Mutex/fn_clientInit.sqf @@ -34,8 +34,7 @@ GVAR(mutexCaches) = false call CFUNC(createNamespace); if (_code isEqualType {}) then { _args call _code; }; - nil - } count +_mutexCache; + } forEach +_mutexCache; // Empty the cache GVAR(mutexCaches) setVariable [_mutexId, []]; diff --git a/addons/CLib/PerFrame/fn_onEachFrameHandler.sqf b/addons/CLib/PerFrame/fn_onEachFrameHandler.sqf index d8dca7c2..1db1f67b 100644 --- a/addons/CLib/PerFrame/fn_onEachFrameHandler.sqf +++ b/addons/CLib/PerFrame/fn_onEachFrameHandler.sqf @@ -34,8 +34,7 @@ GVAR(lastFrameTime) = time; }; [_args, _handle] call _function; }; - nil -} count GVAR(perFrameHandlerArray); +} forEach GVAR(perFrameHandlerArray); if (GVAR(sortWaitArray)) then { GVAR(waitArray) sort true; @@ -90,8 +89,7 @@ if (_delete) then { //Handle the execNextFrame array: { (_x select 0) call (_x select 1); - nil -} count GVAR(currentFrameBuffer); +} forEach GVAR(currentFrameBuffer); //Swap double-buffer: GVAR(currentFrameBuffer) = GVAR(nextFrameBuffer); diff --git a/addons/CLib/PerFrame/fn_removePerframeHandler.sqf b/addons/CLib/PerFrame/fn_removePerframeHandler.sqf index 8d98c2ba..05f61cb3 100644 --- a/addons/CLib/PerFrame/fn_removePerframeHandler.sqf +++ b/addons/CLib/PerFrame/fn_removePerframeHandler.sqf @@ -33,8 +33,7 @@ if (GVAR(deletedIndices) isEqualTo []) then { [{ { GVAR(perFrameHandlerArray) set [_x, objNull]; - nil - } count GVAR(deletedIndices); + } forEach GVAR(deletedIndices); GVAR(perFrameHandlerArray) = GVAR(perFrameHandlerArray) - [objNull]; diff --git a/addons/CLib/PerformanceInfo/fn_dumpPerformanceInfo.sqf b/addons/CLib/PerformanceInfo/fn_dumpPerformanceInfo.sqf index 5ff69f15..16a2df64 100644 --- a/addons/CLib/PerformanceInfo/fn_dumpPerformanceInfo.sqf +++ b/addons/CLib/PerformanceInfo/fn_dumpPerformanceInfo.sqf @@ -92,7 +92,7 @@ if (GVAR(FPSStorage) isNotEqualTo []) then { "; { _text = _text + _x + " "; - } count GVAR(FPSStorage); + } forEach GVAR(FPSStorage); _text call _fnc_outputText; }; @@ -132,8 +132,8 @@ private _temp = []; } count (allVariables _space); _text = format ["%1 have %2 Varialbe", _space, _count]; _text call _fnc_outputText; -} count _searchSpaces; +} forEach _searchSpaces; { _x call _fnc_outputText; -} count _temp; +} forEach _temp; diff --git a/addons/CLib/RemoteExecution/fn_handleIncomeData.sqf b/addons/CLib/RemoteExecution/fn_handleIncomeData.sqf index bf9e2800..8e990eb0 100644 --- a/addons/CLib/RemoteExecution/fn_handleIncomeData.sqf +++ b/addons/CLib/RemoteExecution/fn_handleIncomeData.sqf @@ -62,8 +62,7 @@ private _targets = []; _targets append ((units _var) apply {owner _x}); }; }; - nil -} count _target; +} forEach _target; // exit with no targets are applyed if (_targets isNotEqualTo []) then { @@ -78,8 +77,7 @@ if (_targets isNotEqualTo []) then { } else { _x publicVariableClient QGVAR(remoteExecCode); }; - nil - } count _targets; + } forEach _targets; }; nil // this function should return Nothing diff --git a/addons/CLib/Settings/fn_init.sqf b/addons/CLib/Settings/fn_init.sqf index 5c394dfc..bd02d4fa 100644 --- a/addons/CLib/Settings/fn_init.sqf +++ b/addons/CLib/Settings/fn_init.sqf @@ -21,7 +21,7 @@ if (isServer) then { { [(getArray _x)] call CFUNC(registerSettings); - } count configProperties [configFile >> "CfgClibSettings", "isArray _x", true]; + } forEach configProperties [configFile >> "CfgClibSettings", "isArray _x", true]; }; if (hasInterface) then { @@ -35,7 +35,7 @@ if (hasInterface) then { GVAR(allSettings) setVariable [_x, _var]; }; }; - } count allVariables GVAR(allSettings); + } forEach allVariables GVAR(allSettings); }; #ifdef ISDEV @@ -46,5 +46,5 @@ if (hasInterface) then { private _t = format ["%1: %2,%3,%4", _x, _value, _force, _isClient]; LOG(_t); }; - } count allVariables GVAR(allSettings); + } forEach allVariables GVAR(allSettings); #endif diff --git a/addons/CLib/Settings/fn_registerSettings.sqf b/addons/CLib/Settings/fn_registerSettings.sqf index 18163532..69d12491 100644 --- a/addons/CLib/Settings/fn_registerSettings.sqf +++ b/addons/CLib/Settings/fn_registerSettings.sqf @@ -22,8 +22,7 @@ private _configClasses = [configFile, missionConfigFile] apply { private _temp = _x; { _temp = (_temp >> _x); - nil; - } count _basePath; + } forEach _basePath; _temp }; @@ -99,10 +98,8 @@ private _fnc_getSettingsValue = { } else { _subClasses pushBackUnique _name; }; - nil; - } count configProperties [_x, "true", true]; - nil; -} count _configClasses; + } forEach configProperties [_x, "true", true]; +} forEach _configClasses; GVAR(allSettings) setVariable ["classes:" + _prefix, _subClasses, true]; GVAR(allSettings) setVariable ["settings:" + _prefix, _settings, true]; diff --git a/addons/CLib/Statemachine/fn_copyStatemachine.sqf b/addons/CLib/Statemachine/fn_copyStatemachine.sqf index ade5f3f1..b01916b6 100644 --- a/addons/CLib/Statemachine/fn_copyStatemachine.sqf +++ b/addons/CLib/Statemachine/fn_copyStatemachine.sqf @@ -24,11 +24,9 @@ private _allStates = [_stateMachine, QGVAR(allStatemachineStates)] call CFUNC(al { [_stateMachineNew, _x, _stateMachine getVariable _x, QGVAR(allStatemachineVariables), false] call CFUNC(setVariable); - nil -} count _allVar; +} forEach _allVar; { [_stateMachineNew, _x, _stateMachine getVariable _x, QGVAR(allStatemachineStates), false] call CFUNC(setVariable); - nil -} count _allStates; +} forEach _allStates; _stateMachineNew diff --git a/addons/CLib/Statemachine/fn_createStatemachineFromConfig.sqf b/addons/CLib/Statemachine/fn_createStatemachineFromConfig.sqf index 7960b1b5..e6691f9c 100644 --- a/addons/CLib/Statemachine/fn_createStatemachineFromConfig.sqf +++ b/addons/CLib/Statemachine/fn_createStatemachineFromConfig.sqf @@ -24,8 +24,7 @@ private _stateMachine = call CFUNC(createStatemachine); private _code = getText (_x >> "stateCode"); private _name = configName _x; [_stateMachine, _name, compile _code] call CFUNC(addStatemachineState); - nil -} count ([_configPath, "isClass _x", true] call CFUNC(configProperties)); +} forEach ([_configPath, "isClass _x", true] call CFUNC(configProperties)); private _entryPoint = getText (_configPath >> "entryPoint"); if (_entryPoint != "") then { diff --git a/addons/CLib/StatusEffects/fn_addStatusEffectType.sqf b/addons/CLib/StatusEffects/fn_addStatusEffectType.sqf index 2923777a..578234a6 100644 --- a/addons/CLib/StatusEffects/fn_addStatusEffectType.sqf +++ b/addons/CLib/StatusEffects/fn_addStatusEffectType.sqf @@ -28,4 +28,4 @@ if (_code isEqualTo {}) exitWith { LOG("Empty code passed to addStatusEffectType"); }; -GVAR(StatusEffectsNamespace) setVariable [QGVAR(Code_) + _id, _code]; +GVAR(StatusEffectsNamespace) set [QGVAR(Code_) + _id, _code];