Skip to content

Commit

Permalink
Minor fixes, cleanup, add lint ignore directives (#5176)
Browse files Browse the repository at this point in the history
- Fix bug in getNumberMagazinesIn (func not used)
- Fix bug in seekerFindLaserSpot (func not used yet)
- Everything else is just cleanup
  • Loading branch information
PabstMirror authored and kymckay committed May 31, 2017
1 parent d90f15a commit 00b91be
Show file tree
Hide file tree
Showing 27 changed files with 49 additions and 28 deletions.
1 change: 1 addition & 0 deletions addons/advanced_throwing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;

// Set last thrown time on Vanilla Throwing and Advanced Throwing
["ace_firedPlayer", {
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon"];
if (_weapon == "Throw") then {
_unit setVariable [QGVAR(lastThrownTime), CBA_missionTime];
};
Expand Down
1 change: 1 addition & 0 deletions addons/cargo/functions/fnc_initObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GVAR(initializedItemClasses) pushBack _type;
TRACE_1("Adding load cargo action to class", _type);

private _condition = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(enable) &&
{(_target getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(canLoad))]) == 1} &&
{locked _target < 2} &&
Expand Down
4 changes: 4 additions & 0 deletions addons/cargo/functions/fnc_initVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ if (!hasInterface) exitWith {};
TRACE_1("Adding unload cargo action to class", _type);

private _condition = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)}
};
private _statement = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(interactionVehicle) = _target;
GVAR(interactionParadrop) = false;
createDialog QGVAR(menu);
Expand All @@ -59,13 +61,15 @@ private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call E
// Add the paradrop self interaction for planes and helicopters
if (_vehicle isKindOf "Air") then {
private _condition = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)} && {
private _turretPath = _player call CBA_fnc_turretPath;
(_player == (driver _target)) || // pilot
{(getNumber (([_target, _turretPath] call CBA_fnc_getTurret) >> "isCopilot")) == 1} || // coPilot
{_turretPath in (getArray (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(loadmasterTurrets)))}} // loadMaster turret from config
};
private _statement = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(interactionVehicle) = _target;
GVAR(interactionParadrop) = true;
createDialog QGVAR(menu);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
params ["_client"];

[GVAR(syncedEvents), {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
_value params ["", "_eventLog"];

["ACEs", [_key, _eventLog], _client] call CBA_fnc_targetEvent;
Expand Down
3 changes: 2 additions & 1 deletion addons/common/functions/fnc_cachedCall.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < diag_tickTime) then {
missionNamespace setVariable [_varName, _cacheList];

[_event, {
// _eventName is defined on the function that calls the event
#ifdef DEBUG_MODE_FULL
INFO_1("Clear cached variables on event: %1",_eventName);
#endif
// Get the list of caches to clear
//IGNORE_PRIVATE_WARNING ["_eventName"];
// _eventName is defined on the function that calls the event
private _varName = format [QGVAR(clearCache_%1), _eventName];
private _cacheList = missionNamespace getVariable [_varName, []];
// Erase all the cached results
Expand Down
7 changes: 5 additions & 2 deletions addons/common/functions/fnc_getNumberMagazinesIn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ if (_unit isKindOf "CAManBase") then {
_return = {_x == _magazine} count magazines _unit;
} else {
{
_return = _return + {_x == _magazine} count magazines _x;
_return = _return + ({_x == _magazine} count magazines _x);
false
} count crew _unit;

_return = _return + ({_x == _magazine} count getMagazineCargo _unit);
(getMagazineCargo _unit) params [["_magNames", []], ["_magCount", []]];
{
if (_magazine == _x) exitWith {_return = _return + (_magCount select _forEachIndex)};
} forEach _magNames;
};

_return
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_switchToGroupSide.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
#include "script_component.hpp"

params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", side _unit]];
params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", sideUnknown]];

private _previousGroupsList = _unit getVariable [QGVAR(previousGroupSwitchTo), []];

Expand Down
2 changes: 1 addition & 1 deletion addons/concertina_wire/functions/fnc_deploy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
#include "script_component.hpp"

PARAMS_2(_wirecoil,_unit);
params ["_wirecoil", "_unit"];

private _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0];
{
Expand Down
2 changes: 1 addition & 1 deletion addons/concertina_wire/functions/fnc_dismountSuccess.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
#include "script_component.hpp"

PARAMS_1(_wire);
params ["_wire"];

{
_wire animate [_x, 1];
Expand Down
2 changes: 2 additions & 0 deletions addons/dragging/functions/fnc_handleAnimChanged.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
#include "script_component.hpp"

//IGNORE_PRIVATE_WARNING ["_thisArgs", "_thisID"]; // From CBA_fnc_addBISEventHandler;

params ["_unit", "_anim"];
_thisArgs params ["_realUnit"];
TRACE_4("params",_unit,_anim,_realUnit,_thisID);
Expand Down
2 changes: 1 addition & 1 deletion addons/dragging/functions/fnc_setDraggable.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
#include "script_component.hpp"

//IGNORE_PRIVATE_WARNING("_player", "_target");
//IGNORE_PRIVATE_WARNING ["_player", "_target"];
params ["_object", "_enableDrag", "_position", "_direction"];

if (isNil "_position") then {
Expand Down
1 change: 1 addition & 0 deletions addons/finger/functions/fnc_perFrameEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "Stat
private _iconSize = BASE_SIZE * 0.10713 * (call EFUNC(common,getZoom));

[+GVAR(fingersHash), {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
_value params ["_lastTime", "_pos", "_name"];
private _timeLeftToShow = _lastTime + FP_TIMEOUT - diag_tickTime;
if (_timeLeftToShow <= 0) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/interact_menu/functions/fnc_compileMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Public: No
*/
#include "script_component.hpp";
#include "script_component.hpp"

params ["_target"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Public: No
*/
#include "script_component.hpp";
#include "script_component.hpp"

params ["_target"];

Expand Down
2 changes: 1 addition & 1 deletion addons/interact_menu/functions/fnc_compileMenuZeus.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Public: No
*/
#include "script_component.hpp";
#include "script_component.hpp"

// Exit if the action menu is already compiled for zeus
if !(isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {};
Expand Down
1 change: 1 addition & 0 deletions addons/interact_menu/functions/fnc_isSubPath.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ private _isSubPath = true;

if (count _shortPath > count _longPath) exitWith {false};

//IGNORE_PRIVATE_WARNING ["_i"];
for [{private _i = 0},{_i < count _shortPath},{_i = _i + 1}] do {
if !((_longPath select _i) isEqualTo (_shortPath select _i)) exitWith {
_isSubPath = false;
Expand Down
9 changes: 3 additions & 6 deletions addons/interact_menu/functions/fnc_renderBaseMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if ((_sPos select 0) < safeZoneXAbs || {(_sPos select 0) > safeZoneXAbs + safeZo
if ((_sPos select 1) < safeZoneY || {(_sPos select 1) > safeZoneY + safeZoneH}) exitWith {false};


BEGIN_COUNTER(fnc_collectActiveActionTree)
BEGIN_COUNTER(fnc_collectActiveActionTree);

// Collect active tree
private _uid = format [QGVAR(ATCache_%1), _actionName];
Expand All @@ -71,17 +71,14 @@ private _activeActionTree = [
_object, _uid, 1.0, "ace_interactMenuClosed"
] call EFUNC(common,cachedCall);

END_COUNTER(fnc_collectActiveActionTree)
END_COUNTER(fnc_collectActiveActionTree);

#ifdef DEBUG_MODE_EXTRA
diag_log "Printing: _activeActionTree";
[0, _activeActionTree] call {
params ["_level", "_node"];
_node params ["_actionData", "_children", "_object"];
diag_log text format ["Level %1 -> %2 on %3", _level, _actionData select 0, _object];
{
[_level + 1, _x] call _fnc_print;
} forEach _children;
};
#endif

Expand All @@ -101,6 +98,6 @@ GVAR(collectedActionPoints) pushBack [_sPos select 2, _sPos, _activeActionTree];

END_COUNTER(fnc_renderMenus);

END_COUNTER(fnc_renderBaseMenu)
END_COUNTER(fnc_renderBaseMenu);

true
2 changes: 1 addition & 1 deletion addons/interaction/functions/fnc_canJoinTeam.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
#include "script_component.hpp"

PARAMS_2(_unit,_target);
params ["_unit", "_target"];

alive _target
&& {!(_target getVariable ["ACE_isUnconscious", false])}
Expand Down
4 changes: 2 additions & 2 deletions addons/kestrel4500/functions/fnc_generateOutputData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ if (GVAR(referenceHeadingMenu) == 0) then {
} else {
_textCenterLine1Left = "Max";
_textCenterLine2Left = "Avg";
switch (GVAR(MinAvgMax)Mode) do {
switch (GVAR(MinAvgMaxMode)) do {
case 0: {
_textCenterLine1Right = "--. -";
_textCenterLine2Right = "--. -";
Expand Down Expand Up @@ -175,7 +175,7 @@ if (GVAR(referenceHeadingMenu) == 0) then {
} else {
_textCenterLine1Left = "Max";
_textCenterLine2Left = "Avg";
switch (GVAR(MinAvgMax)Mode) do {
switch (GVAR(MinAvgMaxMode)) do {
case 0: {
_textCenterLine1Right = "--. -";
_textCenterLine2Right = "--. -";
Expand Down
1 change: 1 addition & 0 deletions addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ private _testSeekerDir = vectorDirVisual _seekerVehicle;

// Draw all lasers
[GVAR(laserEmitters), {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
// TRACE_2("",_key,_value);
_value params ["_obj", "_owner", "_laserMethod", "_waveLength", "_laserCode", "_beamSpread"];

Expand Down
9 changes: 5 additions & 4 deletions addons/laser/functions/fnc_seekerFindLaserSpot.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private _finalOwner = objNull;
// Shoot a cone with dispersion
([_laserPos, _laserDir, _divergence, GVAR(dispersionCount), _obj] call FUNC(shootCone)) params ["", "", "_resultPositions"];
{
_testPoint = _x select 0;
private _testPoint = _x select 0;
private _testPointVector = _posASL vectorFromTo _testPoint;
private _testDotProduct = _dir vectorDotProduct _testPointVector;
if ((_testDotProduct > _seekerCos) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then {
Expand All @@ -90,7 +90,7 @@ private _finalOwner = objNull;
if (_distance > 0) then {
private _testPointVector = _posASL vectorFromTo _resultPos;
private _testDotProduct = _dir vectorDotProduct _testPointVector;
if ((_testDotProduct > _seekerCos) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then {
if ((_testDotProduct > _seekerCos) && {(_resultPos vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then {
_spots pushBack [_resultPos, _owner];
};
};
Expand Down Expand Up @@ -178,6 +178,7 @@ if ((count _spots) > 0) then {
private _maxOwnerCount = -1;

[_ownersHash, {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
if (_value > _maxOwnerCount) then {
_finalOwner = _key;
};
Expand All @@ -189,9 +190,9 @@ END_COUNTER(seekerFindLaserSpot);

#ifdef DRAW_LASER_INFO
if (isNil "_finalPos") then {
drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _code], 0.5, 0.025, "TahomaB"];
drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"];
} else {
drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _code], 0.5, 0.025, "TahomaB"];
drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"];
drawLine3D [ASLtoAGL _posASL, ASLtoAGL _finalPos, [0.5,1,0,1]];
};
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ _arrayOfAmmoCounts = +_arrayOfAmmoCounts;
_arrayOfAmmoCounts sort true;

private _fnc_newMag = {
//IGNORE_PRIVATE_WARNING ["_time", "_events"];
_time = _time + GVAR(TimePerMagazine);
_events pushBack [_time, false, +_arrayOfAmmoCounts];
};
Expand Down
2 changes: 1 addition & 1 deletion addons/nametags/functions/fnc_doShow.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Public: No
*/
#include "script_component.hpp"
#include "common.hpp";
#include "common.hpp"

private ["_roleImages", "_player", "_vehicle", "_type", "_config", "_text", "_data", "_isAir", "_turretUnits", "_turretRoles", "_index", "_roleType", "_unit", "_toShow"];

Expand Down
2 changes: 1 addition & 1 deletion addons/nametags/functions/fnc_getVehicleData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Public: No
*/
#include "script_component.hpp"
#include "common.hpp";
#include "common.hpp"

params ["_type"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];

params ["_player"];

//Get the classname of the spare barrel for the weapon
private _weaponBarrelClass = getText (configFile >> 'CfgWeapons' >> currentWeapon _player >> QGVAR(barrelClassname));
Expand All @@ -22,4 +23,4 @@ if(_weaponBarrelClass == "") then {
//Check if the player has the barrel and the weapon can have its barrel swapped
private _canCheckTemperature = GVAR(enabled) && {_weaponBarrelClass in magazines _player};

_canCheckTemperature;
_canCheckTemperature;
2 changes: 2 additions & 0 deletions addons/overheating/functions/fnc_getWeaponData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
#include "script_component.hpp"

params ["_weapon"];

// Look in the cache first
private _weaponData = GVAR(cacheWeaponData) getVariable _weapon;
if (!isNil "_weaponData") exitWith {_weaponData};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

private _pairs = [];
TRACE_1("updateSpareBarrelsTemperaturesThread1",GVAR(storedSpareBarrels));
[GVAR(storedSpareBarrels), {_pairs pushBack [_key, _value];}] call CBA_fnc_hashEachPair;
[GVAR(storedSpareBarrels), {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
_pairs pushBack [_key, _value];
}] call CBA_fnc_hashEachPair;
TRACE_1("updateSpareBarrelsTemperaturesThread2",_pairs);
{
_x params ["_barrelMagazineID","_value"];
Expand Down

0 comments on commit 00b91be

Please sign in to comment.