Skip to content

Commit

Permalink
General - Cleanup some unused/missing vars (#10447)
Browse files Browse the repository at this point in the history
* General - Cleanup some unused vars

* AI - Fix undefined var in garrisonMove

* Update lints.toml
  • Loading branch information
PabstMirror authored Oct 22, 2024
1 parent d7c8460 commit 4c6fec3
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
14 changes: 14 additions & 0 deletions .hemtt/lints.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,17 @@ options.ignore = [
options.ignore = [
"SLX_*", "ACE_*"
]

[sqf.undefined]
enabled = true
options.check_orphan_code = true

[sqf.unused]
#enabled = true #many false positives without DEBUG_MODE_FULL
options.check_params = false

[sqf.shadowed]
enabled = false

[sqf.not_private]
enabled = true
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if (_speed > 2) then {
private _graded = 2.1 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + _terrainFactor * (SIM_BODYMASS + _gearMass) * (0.9 * (_speed ^ 2) + 0.66 * _speed * _terrainGradient);
private _terrainImpact = abs ((_graded / _baseline) - 1);
hintSilent format ["FwdAngle: %1 | SideAngle: %2 \n TerrainFactor: %3 | TerrainGradient: %4 \n TerrainImpact: %5 \n Speed: %6 | CarriedLoad: %7 \n Duty: %8 | Work: %9",
_fwdAngle toFixed 1,
_fwdAngle toFixed 1, //IGNORE_PRIVATE_WARNING ["_fwdAngle", "_sideAngle"]; // from mainLoop
_sideAngle toFixed 1,
_terrainFactor toFixed 2,
_terrainGradient toFixed 1,
Expand Down
1 change: 1 addition & 0 deletions addons/ai/functions/fnc_garrisonMove.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
};

case ((_unitPosTimer + 5) < CBA_missionTime && {_unitOldPos distance _unitPos < 0.5}) : {
(_unit getVariable [QGVAR(garrisonMove_failSafe), [CBA_missionTime, 5]]) params ["_failSafeTimer", "_failSafeRemainingAttemps"];
call _fnc_attemptFailed;
};

Expand Down
6 changes: 0 additions & 6 deletions addons/arsenal/functions/fnc_sortPanel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ private _sortCache = uiNamespace getVariable QGVAR(sortCache);
private _faceCache = uiNamespace getVariable QGVAR(faceCache);
private _insigniaCache = uiNamespace getVariable QGVAR(insigniaCache);

private _countColumns = if (_right) then {
count lnbGetColumnsPosition _panel
} else {
0
};

private _for = if (_right) then {
for "_i" from 0 to (lnbSize _panel select 0) - 1
} else {
Expand Down
2 changes: 0 additions & 2 deletions addons/arsenal/functions/fnc_updateRightPanel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

params ["_control", "_container", "_hasItems"];

private _loadRemaining = maxLoad _container - loadAbs _container;

private _item = "";
private _color = [];
private _alpha = 1;
Expand Down
2 changes: 0 additions & 2 deletions addons/frag/functions/fnc_findReflections.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ if (_zIndex < 5) then {
_zAng = 90;
};
for "_i" from 0 to _radi do {
private _test = true;
private _vec = [1, ((_i * _split) + _rand) % 360, _zAng] call CBA_fnc_polar2vect;
for "_x" from 1 to _distanceCount do {
private _testPos = _pos vectorAdd (_vec vectorMultiply _x);
// drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""];
private _res = lineIntersectsWith [_pos, _testPos];
if (count _res > 0) exitWith {
_test = false;
_nlos pushBack _lastPos;
// {
// _x addEventHandler ["HandleDamage", { diag_log text format ["this: %1", _this]; }];
Expand Down
2 changes: 1 addition & 1 deletion addons/missileguidance/functions/fnc_seekerType_MWR.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then {
_projectile setMissileTarget _target;
} else {
if (GVAR(debug_drawGuidanceInfo)) then {
_seekerTypeName = "MWR - EXT";
_seekerTypeName = "MWR - EXT"; //IGNORE_PRIVATE_WARNING ["_seekerTypeName"]; // from doSeekerSearch
};
// External radar homing
// if the target is in the remote targets for the side, whoever the donor is will "datalink" the target for the hellfire.
Expand Down
3 changes: 0 additions & 3 deletions addons/refuel/functions/fnc_connectNozzleAction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ params [["_unit", objNull, [objNull]], ["_sink", objNull, [objNull]], ["_startin

private _bestPosASL = [];
private _bestPosDistance = 1e38;
private _viewPos = _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [0,0,1])) vectorMultiply 3);
private _modelVector = _startingPosASL vectorFromTo (_sink modelToWorldWorld [0,0,0]);
private _modelVectorLow = _startingPosASL vectorFromTo (_sink modelToWorldWorld [0,0,-1]);

{
private _endPosASL = _x;
Expand Down

0 comments on commit 4c6fec3

Please sign in to comment.