Minor fixes, cleanup, add lint ignore directives (#5176)

- Fix bug in getNumberMagazinesIn (func not used)
- Fix bug in seekerFindLaserSpot (func not used yet)
- Everything else is just cleanup
This commit is contained in:
PabstMirror 2017-05-31 16:09:36 -05:00 committed by SilentSpike
parent d90f15ac7d
commit 00b91bed45
27 changed files with 49 additions and 28 deletions

View File

@ -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];
};

View File

@ -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} &&

View File

@ -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);
@ -59,6 +61,7 @@ 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
@ -66,6 +69,7 @@ if (_vehicle isKindOf "Air") then {
{_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);

View File

@ -15,6 +15,7 @@
params ["_client"];
[GVAR(syncedEvents), {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
_value params ["", "_eventLog"];
["ACEs", [_key, _eventLog], _client] call CBA_fnc_targetEvent;

View File

@ -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

View File

@ -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

View File

@ -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), []];

View File

@ -14,7 +14,7 @@
*/
#include "script_component.hpp"
PARAMS_2(_wirecoil,_unit);
params ["_wirecoil", "_unit"];
private _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0];
{

View File

@ -13,7 +13,7 @@
*/
#include "script_component.hpp"
PARAMS_1(_wire);
params ["_wire"];
{
_wire animate [_x, 1];

View File

@ -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);

View File

@ -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 {

View File

@ -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 {

View File

@ -10,7 +10,7 @@
*
* Public: No
*/
#include "script_component.hpp";
#include "script_component.hpp"
params ["_target"];

View File

@ -10,7 +10,7 @@
*
* Public: No
*/
#include "script_component.hpp";
#include "script_component.hpp"
params ["_target"];

View File

@ -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 {};

View File

@ -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;

View File

@ -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];
@ -71,7 +71,7 @@ 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";
@ -79,9 +79,6 @@ diag_log "Printing: _activeActionTree";
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
@ -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

View File

@ -16,7 +16,7 @@
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
params ["_unit", "_target"];
alive _target
&& {!(_target getVariable ["ACE_isUnconscious", false])}

View File

@ -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 = "--. -";
@ -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 = "--. -";

View File

@ -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"];

View File

@ -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 {
@ -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];
};
};
@ -178,6 +178,7 @@ if ((count _spots) > 0) then {
private _maxOwnerCount = -1;
[_ownersHash, {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
if (_value > _maxOwnerCount) then {
_finalOwner = _key;
};
@ -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

View File

@ -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];
};

View File

@ -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"];

View File

@ -18,7 +18,7 @@
* Public: No
*/
#include "script_component.hpp"
#include "common.hpp";
#include "common.hpp"
params ["_type"];

View File

@ -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));

View File

@ -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};

View File

@ -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"];