From 82cd4bdf1e5bbe2de0dba03bf0973862460de5ea Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 7 Oct 2024 18:25:29 -0500 Subject: [PATCH 1/5] Cleanup - Add private and remove some unused vars --- addons/common/fnc_getAnimType.sqf | 6 +++--- addons/common/fnc_getNearest.sqf | 2 +- addons/common/fnc_isTurnedOut.sqf | 4 ---- addons/common/fnc_mapGridToPos.sqf | 15 +++++++------- addons/common/fnc_switchPlayer.sqf | 2 +- .../fnc_initExtendedDebugConsole.sqf | 2 +- .../keybinding/fnc_addKeybindToFleximenu.sqf | 8 ++++---- addons/keybinding/fnc_gui_configure.sqf | 20 +++++++++---------- .../keybinding/fnc_initDisplayConfigure.sqf | 2 +- addons/keybinding/fnc_registerKeybind.sqf | 4 ++-- .../fnc_registerKeybindToFleximenu.sqf | 6 +++--- addons/modules/fnc_moduleDefend.sqf | 2 +- addons/modules/fnc_modulePatrol.sqf | 4 ++-- addons/music/fnc_findMusic.sqf | 4 ++-- addons/settings/fnc_gui_export.sqf | 2 +- addons/settings/fnc_gui_preset.sqf | 2 +- addons/strings/fnc_formatElapsedTime.sqf | 2 +- addons/ui/fnc_initDisplayInterrupt.sqf | 14 ++++++------- addons/ui/fnc_initDisplayInventory.sqf | 2 +- addons/ui/fnc_preload3DEN.sqf | 2 +- addons/ui/fnc_preloadCurator.sqf | 4 ++-- addons/versioning/XEH_postInitServer.sqf | 4 ++-- 22 files changed, 54 insertions(+), 59 deletions(-) diff --git a/addons/common/fnc_getAnimType.sqf b/addons/common/fnc_getAnimType.sqf index b78efe8601..ba6680156f 100644 --- a/addons/common/fnc_getAnimType.sqf +++ b/addons/common/fnc_getAnimType.sqf @@ -28,10 +28,10 @@ private _weapon = format["%1", currentWeapon _man]; private _pos = ""; if (_weapon != "") then { - _class = configFile >> "CfgWeapons" >> _weapon; + private _class = configFile >> "CfgWeapons" >> _weapon; if (isClass _class) then { - _temp = ""; + private _temp = ""; while { isClass _class && {_temp == ""} } do { _temp = switch (configName _class) do { case "RifleCore": {"rfl"}; @@ -50,7 +50,7 @@ if (_weapon != "") then { }; if (typeName (_array select 0) == "ARRAY") then { - _stance = (_man call CBA_fnc_getUnitAnim) select 0; + private _stance = (_man call CBA_fnc_getUnitAnim) select 0; _pos = switch ( _stance ) do { case "stand": {0}; case "kneel": {1}; diff --git a/addons/common/fnc_getNearest.sqf b/addons/common/fnc_getNearest.sqf index bedd599847..3b329699bc 100644 --- a/addons/common/fnc_getNearest.sqf +++ b/addons/common/fnc_getNearest.sqf @@ -37,7 +37,7 @@ params [ private _return = [[], objNull] select (isNil {param [2]}); { - _distance = [_position, _x] call CBA_fnc_getDistance; + private _distance = [_position, _x] call CBA_fnc_getDistance; if (_distance < _radius) then { if !(call _code) exitWith {}; // don't move up. condition has to return false, vs. has to return true. Can be nil! diff --git a/addons/common/fnc_isTurnedOut.sqf b/addons/common/fnc_isTurnedOut.sqf index aab149640f..6f3bfb2e80 100644 --- a/addons/common/fnc_isTurnedOut.sqf +++ b/addons/common/fnc_isTurnedOut.sqf @@ -38,7 +38,6 @@ private _cfg = configOf _vehicle; if (_vehicle != _unit) then { if (driver _vehicle == _unit) then { - private _forceHideDriver = getNumber (_cfg >> "forceHideDriver"); _out = _vehicle animationPhase "hatchDriver" > 0; } else { private _assignedRole = assignedVehicleRole _unit; @@ -47,9 +46,6 @@ if (_vehicle != _unit) then { private _turretPath = _assignedRole select 1; private _turret = [_vehicle, _turretPath] call CBA_fnc_getTurret; - private _canHideGunner = getNumber (_turret >> "canHideGunner"); - private _forceHideGunner = getNumber (_turret >> "forceHideGunner"); - private _hatchAnimation = getText (_turret >> "animationSourceHatch"); _out = (_vehicle animationPhase _hatchAnimation) > 0; } else { diff --git a/addons/common/fnc_mapGridToPos.sqf b/addons/common/fnc_mapGridToPos.sqf index a27ed4924c..27be682c7d 100644 --- a/addons/common/fnc_mapGridToPos.sqf +++ b/addons/common/fnc_mapGridToPos.sqf @@ -88,11 +88,11 @@ if (IS_STRING(_pos)) then { _height = (_maxNorthing*100) - abs(_minus) + 1; } else { if (isNil QGVAR(rvOriginX) || {isNil QGVAR(rvOriginY)}) then { - _start = format["%1", mapGridPosition [0, 0]]; - _size = toArray _start; - _rvOriginY = 0; - _rvOriginX = 0; - _ignore = false; + private _start = format["%1", mapGridPosition [0, 0]]; + private _size = toArray _start; + private _rvOriginY = 0; + private _rvOriginX = 0; + private _ignore = false; switch (count _size) do { case 2: { _rvOriginY = (parseNumber (toString [(_size select 1)]))*10000; @@ -170,9 +170,8 @@ if (_doOffSet && {(_northingMultiple max _eastingMultiple) > 1}) then { }; // Return position. -_return = if (_reversed) then { +if (_reversed) then { [_posX+_offset, _posY-_offset, 0] } else { [_posX+_offset-GVAR(rvOriginX), _posY+_offset-GVAR(rvOriginY), 0] -}; -_return +} diff --git a/addons/common/fnc_switchPlayer.sqf b/addons/common/fnc_switchPlayer.sqf index c9c857ffa5..e0404b9c74 100644 --- a/addons/common/fnc_switchPlayer.sqf +++ b/addons/common/fnc_switchPlayer.sqf @@ -39,7 +39,7 @@ private _ar = [weapons _oldUnit, magazines _oldUnit, rank _oldUnit, score _oldUn private _dummyGroup = createGroup (side _oldUnit); if (isNull _dummyGroup) exitWith { hint "Sorry, something went wrong, dummyGroup is null" }; -_dummyUnit = (_ar select 4) createUnit [_type, [0, 0, 0], [], 0, "NONE"]; // Join in the old group incase there was only 1 member +private _dummyUnit = (_ar select 4) createUnit [_type, [0, 0, 0], [], 0, "NONE"]; // Join in the old group incase there was only 1 member if (isNull _dummyUnit) exitWith { hint "Sorry, something went wrong, dummyUnit is null" }; [_oldUnit] join _dummyGroup; diff --git a/addons/diagnostic/fnc_initExtendedDebugConsole.sqf b/addons/diagnostic/fnc_initExtendedDebugConsole.sqf index 4677478137..86b793de67 100644 --- a/addons/diagnostic/fnc_initExtendedDebugConsole.sqf +++ b/addons/diagnostic/fnc_initExtendedDebugConsole.sqf @@ -273,7 +273,7 @@ FUNC(nextStatement) = { }; FUNC(removeIndentation) = { - params ["_control", "_text", "_index"]; + params ["_expression", "_text", "_index"]; private _chars = toArray _text; private _indexRev = count _chars - _index; diff --git a/addons/keybinding/fnc_addKeybindToFleximenu.sqf b/addons/keybinding/fnc_addKeybindToFleximenu.sqf index 6e1518e24f..0df018750d 100644 --- a/addons/keybinding/fnc_addKeybindToFleximenu.sqf +++ b/addons/keybinding/fnc_addKeybindToFleximenu.sqf @@ -35,7 +35,7 @@ Author: // Clients only. if (isDedicated) exitWith {}; -_nullKeybind = [-1, [false, false, false]]; +private _nullKeybind = [-1, [false, false, false]]; params ["_modName", "_actionId", "_displayName", "_fleximenuDef", ["_defaultKeybind", _nullKeybind], ["_holdKey", true], ["_holdDelay", 0], ["_overwrite", false]]; @@ -52,10 +52,10 @@ if (count (_fleximenuDef select 1) > 0) then { _fleximenuDef call cba_fnc_flexiMenu_add; // Create the code to open the fleximenu. -_downCode = compile format ["%1 call cba_fnc_fleximenu_openMenuByDef;", _fleximenuDef]; -_upCode = {}; +private _downCode = compile format ["%1 call cba_fnc_fleximenu_openMenuByDef;", _fleximenuDef]; +private _upCode = {}; // Pass everything to the new API cba_fnc_addKeybind. -_keybind = [_modName, _actionId, _displayName, _downCode, _upCode, _defaultKeybind, _holdKey, _holdDelay, _overwrite] call CBA_fnc_addKeybind; +private _keybind = [_modName, _actionId, _displayName, _downCode, _upCode, _defaultKeybind, _holdKey, _holdDelay, _overwrite] call CBA_fnc_addKeybind; _keybind; diff --git a/addons/keybinding/fnc_gui_configure.sqf b/addons/keybinding/fnc_gui_configure.sqf index ce1c843258..4758b4424b 100644 --- a/addons/keybinding/fnc_gui_configure.sqf +++ b/addons/keybinding/fnc_gui_configure.sqf @@ -6,17 +6,17 @@ params ["_control"]; // get dialog private _display = ctrlParent _control; -_ctrlKeyboardGroup = _display displayCtrl 2300; -_ctrlMouseGroup = _display displayCtrl 2301; -_ctrlKeyboardButton = _display displayCtrl 2400; -_ctrlMouseButton = _display displayCtrl 2401; -_ctrlControllerButton = _display displayCtrl 106; -_ctrlPresetButton = _display displayCtrl 114; -_ctrlDefaultButton = _display displayCtrl 101; +private _ctrlKeyboardGroup = _display displayCtrl 2300; +private _ctrlMouseGroup = _display displayCtrl 2301; +private _ctrlKeyboardButton = _display displayCtrl 2400; +private _ctrlMouseButton = _display displayCtrl 2401; +private _ctrlControllerButton = _display displayCtrl 106; +private _ctrlPresetButton = _display displayCtrl 114; +private _ctrlDefaultButton = _display displayCtrl 101; -_ctrlKeyboardButtonFake = _display displayCtrl IDC_BTN_KEYBOARD_FAKE; -_ctrlAddonsGroup = _display displayCtrl IDC_ADDONS_GROUP; -_ctrlToggleButton = _display displayCtrl IDC_BTN_CONFIGURE_ADDONS; +private _ctrlKeyboardButtonFake = _display displayCtrl IDC_BTN_KEYBOARD_FAKE; +private _ctrlAddonsGroup = _display displayCtrl IDC_ADDONS_GROUP; +private _ctrlToggleButton = _display displayCtrl IDC_BTN_CONFIGURE_ADDONS; // Toggle displayed groups and buttons. if !(ctrlShown _ctrlAddonsGroup) then { diff --git a/addons/keybinding/fnc_initDisplayConfigure.sqf b/addons/keybinding/fnc_initDisplayConfigure.sqf index 6858a198a6..7787beab2f 100644 --- a/addons/keybinding/fnc_initDisplayConfigure.sqf +++ b/addons/keybinding/fnc_initDisplayConfigure.sqf @@ -65,7 +65,7 @@ _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", { // overwrite with new keyhandlers { - _keybind = _x; + private _keybind = _x; if (_downCode isNotEqualTo {}) then { [_keybind select 0, _keybind select 1, _downCode, "keyDown", format ["%1_down_%2", _action, _forEachIndex], _holdKey, _holdDelay] call CBA_fnc_addKeyHandler; diff --git a/addons/keybinding/fnc_registerKeybind.sqf b/addons/keybinding/fnc_registerKeybind.sqf index fb723f72f6..d0be8868f8 100644 --- a/addons/keybinding/fnc_registerKeybind.sqf +++ b/addons/keybinding/fnc_registerKeybind.sqf @@ -12,7 +12,7 @@ Author: if (isDedicated) exitWith {}; diag_log text format ["[CBA Keybinding] WARNING: %1=>%2 called cba_fnc_registerKeybind is no longer a valid function and has been replaced with cba_fnc_addKeybind. Contact the developer of mod %1 to change the code to use the new function.", _this select 0, _this select 1]; -_nullKeybind = [-1, false, false, false]; +private _nullKeybind = [-1, false, false, false]; params ["_modName", "_actionName", "_code", ["_defaultKeybind", _nullKeybind], ["_overwrite", false], ["_keypressType", "KeyDown"]]; @@ -26,7 +26,7 @@ if (count _defaultKeybind != 4) then { // Key format is not known, set to nil and warn _defaultKeybind = _nullKeybind; - _warn = ["[CBA Keybinding] ERROR: Invalid keybind format %1 for %2 %3. Using null keybind.", _defaultKeybind, _modName, _actionName]; + private _warn = ["[CBA Keybinding] ERROR: Invalid keybind format %1 for %2 %3. Using null keybind.", _defaultKeybind, _modName, _actionName]; _warn call BIS_fnc_error; diag_log format _warn; }; diff --git a/addons/keybinding/fnc_registerKeybindToFleximenu.sqf b/addons/keybinding/fnc_registerKeybindToFleximenu.sqf index a858f3eff7..b85c3c29f9 100644 --- a/addons/keybinding/fnc_registerKeybindToFleximenu.sqf +++ b/addons/keybinding/fnc_registerKeybindToFleximenu.sqf @@ -33,7 +33,7 @@ Author: if (isDedicated) exitWith {}; diag_log text format ["[CBA Keybinding] WARNING: %1=>%2 called CBA_fnc_registerKeybindToFleximenu is no longer a valid function and has been replaced with CBA_fnc_addKeybindToFleximenu. Contact the developer of mod %1 to change the code to use the new function.", _this select 0,_this select 1]; -_nullKeybind = [-1, false, false, false]; +private _nullKeybind = [-1, false, false, false]; params ["_modName", "_actionName", "_fleximenuDef", ["_defaultKeybind", _nullKeybind], ["_overwrite", false], ["_keypressType", "KeyDown"]]; @@ -48,9 +48,9 @@ if (count (_fleximenuDef select 1) > 0) then { _fleximenuDef call cba_fnc_flexiMenu_add; // Create the code to open the fleximenu. -_code = compile format ["%1 call cba_fnc_fleximenu_openMenuByDef;", _fleximenuDef]; +private _code = compile format ["%1 call cba_fnc_fleximenu_openMenuByDef;", _fleximenuDef]; // Pass everything to the real cba_fnc_registerKeybind. -_keybind = [_modName, _actionName, _code, _defaultKeybind, _overwrite, _keypressType] call CBA_fnc_registerKeybind; +private _keybind = [_modName, _actionName, _code, _defaultKeybind, _overwrite, _keypressType] call CBA_fnc_registerKeybind; _keybind; diff --git a/addons/modules/fnc_moduleDefend.sqf b/addons/modules/fnc_moduleDefend.sqf index 882ae33ab8..aaa196e5cc 100644 --- a/addons/modules/fnc_moduleDefend.sqf +++ b/addons/modules/fnc_moduleDefend.sqf @@ -64,7 +64,7 @@ if (isNil "_defendPos") then {_defendSetPos = true;}; // Define if allowed to patrol _canPatrol = _logic getVariable ["canPatrol", 0.1]; -_shouldHold = _logic getVariable ["shouldHold", 0]; +private _shouldHold = _logic getVariable ["shouldHold", 0]; // Command local group leaders to defend area _defendRadius = _logic getVariable ["defendRadius", 25]; diff --git a/addons/modules/fnc_modulePatrol.sqf b/addons/modules/fnc_modulePatrol.sqf index 02e1626766..876f8faa1b 100644 --- a/addons/modules/fnc_modulePatrol.sqf +++ b/addons/modules/fnc_modulePatrol.sqf @@ -72,9 +72,9 @@ _localGroups = _groups select {local _x}; if (_localGroups isEqualTo []) exitWith {}; // Define variables -_patrolLocType = _logic getVariable ["patrolLocType", ""]; +private _patrolLocType = _logic getVariable ["patrolLocType", ""]; _patrolPos = _logic getVariable ["patrolPosition", objNull]; -_patrolSetPos = false; +private _patrolSetPos = false; // Parse patrol position from string _patrolPos = [_patrolLocType, _patrolPos] call CBA_fnc_getPosFromString; diff --git a/addons/music/fnc_findMusic.sqf b/addons/music/fnc_findMusic.sqf index b8728d24a9..118f50b038 100644 --- a/addons/music/fnc_findMusic.sqf +++ b/addons/music/fnc_findMusic.sqf @@ -61,8 +61,8 @@ private _results = []; _tags pushBackUnique _theme; //Take the theme if no tags found - for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { - _tag = toLower (_tags select _i); + for [{private _i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { + private _tag = toLower (_tags select _i); if (count _searchTags == 0 || {_tag in _searchTags}) then { _i = count _tags; _results pushBackUnique _track; diff --git a/addons/settings/fnc_gui_export.sqf b/addons/settings/fnc_gui_export.sqf index 2458868a51..fab2a48d4a 100644 --- a/addons/settings/fnc_gui_export.sqf +++ b/addons/settings/fnc_gui_export.sqf @@ -2,7 +2,7 @@ params ["_parentDisplay", "_mode"]; -_display = _parentDisplay createDisplay QGVAR(export); +private _display = _parentDisplay createDisplay QGVAR(export); private _ctrlPresetsGroup = _display displayCtrl IDC_EXPORT_GROUP; private _ctrlTitle = _display displayCtrl IDC_EXPORT_TITLE; diff --git a/addons/settings/fnc_gui_preset.sqf b/addons/settings/fnc_gui_preset.sqf index c3138f99fb..e3668a7958 100644 --- a/addons/settings/fnc_gui_preset.sqf +++ b/addons/settings/fnc_gui_preset.sqf @@ -3,7 +3,7 @@ // get button params ["_parentDisplay", "_mode"]; -_display = _parentDisplay createDisplay QGVAR(presets); +private _display = _parentDisplay createDisplay QGVAR(presets); private _ctrlPresetsGroup = _display displayCtrl IDC_PRESETS_GROUP; private _ctrlTitle = _display displayCtrl IDC_PRESETS_TITLE; diff --git a/addons/strings/fnc_formatElapsedTime.sqf b/addons/strings/fnc_formatElapsedTime.sqf index 2d658c84b0..dfa0a9c64d 100644 --- a/addons/strings/fnc_formatElapsedTime.sqf +++ b/addons/strings/fnc_formatElapsedTime.sqf @@ -34,7 +34,7 @@ private _minutes = floor (_seconds / 60); _seconds = _seconds - (_minutes * 60); // Add the milliseconds if required. -_elapsed = switch (_format) do { +private _elapsed = switch (_format) do { case "H:MM:SS": { format ["%1:%2:%3", _hours, diff --git a/addons/ui/fnc_initDisplayInterrupt.sqf b/addons/ui/fnc_initDisplayInterrupt.sqf index a4c23089b2..31d4f19542 100644 --- a/addons/ui/fnc_initDisplayInterrupt.sqf +++ b/addons/ui/fnc_initDisplayInterrupt.sqf @@ -76,26 +76,26 @@ _button ctrlRemoveEventHandler ["ButtonClick", 0]; // remove vanilla button _button ctrlAddEventHandler ["ButtonClick", { // this is an edit of a BI script, don't change unnecessarily params ["_ctrl"]; - _display = ctrlParent _ctrl; + private _display = ctrlParent _ctrl; if (!ctrlCommitted _ctrl) exitWith {}; - _buttons = + (_display getVariable QGVAR(MenuButtons)); + private _buttons = + (_display getVariable QGVAR(MenuButtons)); - _offset = 0; + private _offset = 0; if (!isMultiplayer && {getNumber (missionConfigFile >> "replaceAbortButton") > 0}) then { _offset = 1.1; }; - _upperPartTime = 0.05 * count _buttons; - _buttonsTime = 0.05; + private _upperPartTime = 0.05 * count _buttons; + private _buttonsTime = 0.05; //hide buttons and collapse accordion if (uiNamespace getVariable "BIS_DisplayInterrupt_isOptionsExpanded") then { //move down - background, title, player's name, play, editor, profile, options //Title background - _control = _display displayCtrl 1050; + private _control = _display displayCtrl 1050; _control ctrlSetPosition [1 * GUI_GRID_W + GUI_GRID_X, (14.2 - _offset) * GUI_GRID_H + GUI_GRID_Y]; _control ctrlCommit _upperPartTime; @@ -167,7 +167,7 @@ _button ctrlAddEventHandler ["ButtonClick", { _offset = _offset + (count _buttons - 4) * 1.1; //Title background - _control = _display displayCtrl 1050; + private _control = _display displayCtrl 1050; _control ctrlSetPosition [1 * GUI_GRID_W + GUI_GRID_X, (9.8 - _offset) * GUI_GRID_H + GUI_GRID_Y]; _control ctrlCommit _upperPartTime; diff --git a/addons/ui/fnc_initDisplayInventory.sqf b/addons/ui/fnc_initDisplayInventory.sqf index fde3556abe..26ceec50dc 100644 --- a/addons/ui/fnc_initDisplayInventory.sqf +++ b/addons/ui/fnc_initDisplayInventory.sqf @@ -257,7 +257,7 @@ if !(isNil QGVAR(renamedItems)) then { private _control = _x; if (ctrlShown _control) then { - for [{_i = 0}, {_i < (lbSize _control)}, {_i = _i + 1}] do { + for [{private _i = 0}, {_i < (lbSize _control)}, {_i = _i + 1}] do { private _classname = ([_control, _i] call FUNC(getInventoryItemData)) select 0; if (!isNil "_classname") then { private _renameParams = GVAR(renamedItems) getOrDefault [_classname, []]; diff --git a/addons/ui/fnc_preload3DEN.sqf b/addons/ui/fnc_preload3DEN.sqf index 4938fc2b1d..ca4693ff64 100644 --- a/addons/ui/fnc_preload3DEN.sqf +++ b/addons/ui/fnc_preload3DEN.sqf @@ -101,7 +101,7 @@ private _cache = []; private _listItem = _list select _index; if (_isPublic) then { - _displayName = getText (_weaponConfig >> "displayName"); + private _displayName = getText (_weaponConfig >> "displayName"); // append display name with attachment names { diff --git a/addons/ui/fnc_preloadCurator.sqf b/addons/ui/fnc_preloadCurator.sqf index 908e1ebb6b..224ad18d32 100644 --- a/addons/ui/fnc_preloadCurator.sqf +++ b/addons/ui/fnc_preloadCurator.sqf @@ -94,7 +94,7 @@ private _cache = []; { private _patchConfig = _cfgPatches >> _x; - _addon = toLower _x; + private _addon = toLower _x; private _addonList = [[],[],[],[],[],[],[],[],[],[],[],[]]; @@ -109,7 +109,7 @@ private _cache = []; private _listItem = _addonList select _index; if (_isPublic) then { - _displayName = getText (_weaponConfig >> "displayName"); + private _displayName = getText (_weaponConfig >> "displayName"); // append display name with attachment names { diff --git a/addons/versioning/XEH_postInitServer.sqf b/addons/versioning/XEH_postInitServer.sqf index 8b0d372064..e98570be41 100644 --- a/addons/versioning/XEH_postInitServer.sqf +++ b/addons/versioning/XEH_postInitServer.sqf @@ -34,8 +34,8 @@ QGVAR(mismatch) addPublicVariableEventHandler { (_this select 1) call FUNC(handl private "_str"; _str = 'if(isServer)exitWith{};if (isNil "CBA_display_ingame_warnings") then { CBA_display_ingame_warnings = true; };LOG("cba_versioning_check");0 = objNull spawn { sleep 1; sleep 1; _func={GVAR(mismatch)=[format["%2 (%1)",name player, player],_this];publicVariable QGVAR(mismatch);_this spawn{_t=format["You are missing the following mod: %1",_this];diag_log text _t;sleep 2;if (CBA_display_ingame_warnings) then {player globalChat _t}}};'; [GVAR(versions_serv), { - _cfg = (configFile >> "CfgSettings" >> "CBA" >> "Versioning" >> _key); - _addon = if (isClass _cfg) then { if (isText (_cfg >> "main_addon")) then { getText (_cfg >> "main_addon") } else { _key + "_main" }; } else { _key + "_main" }; + private _cfg = (configFile >> "CfgSettings" >> "CBA" >> "Versioning" >> _key); + private _addon = if (isClass _cfg) then { if (isText (_cfg >> "main_addon")) then { getText (_cfg >> "main_addon") } else { _key + "_main" }; } else { _key + "_main" }; // TODO: Make sensitive to level, if -2, do not check for mod _str = _str + format['if !(isClass(configFile >> "CfgPatches" >> "%1"))exitWith{"%1" call _func};', _addon]; }] call CBA_fnc_hashEachPair; From 8f8ebbcca7254963b2f4b3d9dfb82647f5a257ca Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 10 Nov 2024 15:35:50 -0600 Subject: [PATCH 2/5] cleanup 2 --- .hemtt/lints.toml | 14 ++++++++++++++ addons/common/fnc_getTerrainProfile.sqf | 2 +- addons/hashes/fnc_parseYAML.sqf | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml index 307aa7f4bc..b10d6e9e14 100644 --- a/.hemtt/lints.toml +++ b/.hemtt/lints.toml @@ -7,3 +7,17 @@ options.ignore = [ options.ignore = [ "SLX_*" ] + +[sqf.undefined] +enabled = true +options.check_oprhan_code = true + +[sqf.unused] +enabled = false +options.check_params = false + +[sqf.shadowed] +enabled = false + +[sqf.not_private] +enabled = false diff --git a/addons/common/fnc_getTerrainProfile.sqf b/addons/common/fnc_getTerrainProfile.sqf index 6fdba4bdad..5bc962d90d 100644 --- a/addons/common/fnc_getTerrainProfile.sqf +++ b/addons/common/fnc_getTerrainProfile.sqf @@ -37,7 +37,7 @@ private _return = []; private _pos = []; for "_i" from 0 to (_2Ddistance / _resolution) do { - _adj = _resolution * _i; + private _adj = _resolution * _i; _pos = [_posA, _adj, _angle] call BIS_fnc_relPos; _logic setPosATL _pos; private _alt = ((getPosASL _logic) select 2) - _z; diff --git a/addons/hashes/fnc_parseYAML.sqf b/addons/hashes/fnc_parseYAML.sqf index a04cc5d5f6..e087ecf70c 100644 --- a/addons/hashes/fnc_parseYAML.sqf +++ b/addons/hashes/fnc_parseYAML.sqf @@ -271,7 +271,7 @@ if (count _yaml > 0) then _pos = -1; -_retVal = ([_yaml, _pos, -1, [[]]] call _parse); +private _retVal = ([_yaml, _pos, -1, [[]]] call _parse); _pos = _retVal select 0; _value = _retVal select 1; _error = _retVal select 2; From a1022d6ca3beeca87165c2aa7539a6f2f2f2ac33 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 24 Nov 2024 14:05:39 -0600 Subject: [PATCH 3/5] Fix orphan spelling --- .hemtt/lints.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml index b10d6e9e14..02fe54c844 100644 --- a/.hemtt/lints.toml +++ b/.hemtt/lints.toml @@ -10,7 +10,7 @@ options.ignore = [ [sqf.undefined] enabled = true -options.check_oprhan_code = true +options.check_orphan_code = true [sqf.unused] enabled = false From 71bf6cec2160306a8367148d23595d906a6c2b98 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 14 Dec 2024 00:14:13 -0600 Subject: [PATCH 4/5] Update lints.toml --- .hemtt/lints.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml index 02fe54c844..82133bf446 100644 --- a/.hemtt/lints.toml +++ b/.hemtt/lints.toml @@ -10,7 +10,7 @@ options.ignore = [ [sqf.undefined] enabled = true -options.check_orphan_code = true +options.check_orphan_code = false [sqf.unused] enabled = false From c92901923998d836c0177a465c2a4a557e430eb7 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 20 Dec 2024 00:52:00 -0600 Subject: [PATCH 5/5] cleanup lints, add `allow_no_extension = true` --- .hemtt/lints.toml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml index 82133bf446..c353f04c40 100644 --- a/.hemtt/lints.toml +++ b/.hemtt/lints.toml @@ -1,3 +1,6 @@ +[config.file_type] +options.allow_no_extension = true + [sqf.banned_commands] options.ignore = [ "addPublicVariableEventHandler", # Alt syntax is broken, we are using main syntax @@ -7,17 +10,3 @@ options.ignore = [ options.ignore = [ "SLX_*" ] - -[sqf.undefined] -enabled = true -options.check_orphan_code = false - -[sqf.unused] -enabled = false -options.check_params = false - -[sqf.shadowed] -enabled = false - -[sqf.not_private] -enabled = false