diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 01c00511cf..29a4859651 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -13,6 +13,8 @@ */ #include "script_component.hpp" +private ["_interval", "_player", "_newVel", "_accel", "_currentGForce", "_average", "_sum", "_classCoef", "_suitCoef", "_gBlackOut", "_gRedOut", "_g", "_gBO", "_coef", "_strength"]; + EXPLODE_2_PVT(_this,_params,_pfhId); _interval = time - GVAR(lastUpdateTime); diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index c84ee33b33..75e61dab56 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount"]; +private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"]; PARAMS_1(_grenade); diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index a83c81e660..377793ca7b 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -19,7 +19,8 @@ PARAMS_1(_projectile); if (alive _projectile) then { playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400]; - + + private "_affected"; _affected = _projectile nearEntities ["CAManBase", 50]; ["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent); }; diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index fd97aeda0c..b2b9ed5c00 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -12,6 +12,8 @@ PREP(sendMarkersJIP); PREP(setMarkerJIP); PREP(setMarkerNetwork); +private ["_config", "_marker", "_a", "_scope", "_icon", "_rgba", "_name"]; + // init marker types if (isNil QGVAR(MarkersCache)) then { _config = configfile >> "CfgMarkers"; diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index 6ac13f9e80..6c5160c031 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -19,6 +19,8 @@ #define BORDER 0.005 [{ + private ["_display", "_text", "_picture", "_channel", "_buttonOK", "_buttonCancel", "_description", "_title", "_descriptionChannel", "_sizeX", "_sizeY", "_aceShapeLB", "_aceColorLB", "_aceAngleSlider", "_aceAngleSliderText", "_mapIDD", "_pos", "_posX", "_posY", "_posW", "_posH", "_offsetButtons", "_buttonOk", "_curSelShape", "_curSelColor", "_curSelAngle"]; + disableserialization; PARAMS_1(_display); diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index c917eb0a8d..99c94b4512 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -54,6 +54,8 @@ GVAR(rangeFinderPositionASL) = []; GVAR(mapAltitude) = getNumber (configFile >> "CfgWorlds" >> worldName >> "elevationOffset"); +private ["_worldMapLong", "_worldMapLat", "_zone", "_band", "_squareID"]; + //Calculate the map's MGRS: _worldMapLong = getNumber (configFile >> "CfgWorlds" >> worldName >> "longitude"); _worldMapLat = getNumber (configFile >> "CfgWorlds" >> worldName >> "latitude"); diff --git a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf index 6912810f58..c383d0a95e 100644 --- a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf @@ -19,6 +19,8 @@ PARAMS_2(_waypointName,_waypointPosASL); +private "_waypoints"; + _waypoints = ace_player getVariable [QGVAR(waypoints), []]; _waypoints pushBack [_waypointName, _waypointPosASL]; ace_player setVariable [QGVAR(waypoints), _waypoints]; diff --git a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf index 3d1e8ec852..62ca5a222a 100644 --- a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf @@ -18,6 +18,8 @@ PARAMS_1(_wpIndex); +private "_waypoints"; + _waypoints = ace_player getVariable [QGVAR(waypoints), []]; if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");}; diff --git a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf index f36d5f2548..21a164ff2e 100644 --- a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf +++ b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf @@ -20,6 +20,8 @@ PARAMS_4(_theMap,_mouseButton,_xPos,_yPos); +private ["_worldPos"]; + //Only handle LMB if (_mouseButton != 0) exitWith {}; diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 3acf3e889c..bff20a4b67 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -17,7 +17,8 @@ PARAMS_1(_theMap); -_theMap = _this select 0; +private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"]; + _mapSize = (ctrlPosition _theMap) select 3; _waypoints = [] call FUNC(deviceGetWaypoints); diff --git a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf index 1f4982d87f..64a5cab991 100644 --- a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf +++ b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf @@ -1,7 +1,7 @@ /* * Author: PabstMirror * Saves the current mode and sets a new mode - * Used to backup display when switching display modes + * Used to backup display when switching display modes * * Arguments: * 0: New Mode @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_display", "_theMap", "_mapSize", "_centerPos"]; +private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"]; PARAMS_1(_newMode); @@ -36,16 +36,16 @@ if (GVAR(currentApplicationPage) == 2) then { _centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)]; GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos; GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize; - + //Hit button again, toggle map modes: if (_newMode == 2) then { - if (GVAR(mapShowTexture)) then { - GVAR(mapShowTexture) = false; - } else { + if (GVAR(mapShowTexture)) then { + GVAR(mapShowTexture) = false; + } else { if (GVAR(MapDataAvailable) == MAP_DETAIL_SAT) then { GVAR(mapShowTexture) = true; }; - }; + }; }; }; diff --git a/addons/movement/functions/fnc_canClimb.sqf b/addons/movement/functions/fnc_canClimb.sqf index 27753d8a12..d9946f381c 100644 --- a/addons/movement/functions/fnc_canClimb.sqf +++ b/addons/movement/functions/fnc_canClimb.sqf @@ -9,15 +9,15 @@ * The return value * * Example: - * _bool = [player] call ace_movement_fnc_canClimb + * [player] call ace_movement_fnc_canClimb * * Public: No */ #include "script_component.hpp" -private ["_unit", "_pos", "_dir"]; +private ["_pos", "_dir"]; -_unit = _this select 0; +PARAMS_1(_unit); _pos = getPosASL _unit; _dir = getDir _unit; diff --git a/addons/movement/functions/fnc_getWeight.sqf b/addons/movement/functions/fnc_getWeight.sqf index 955be1a215..6941173fde 100644 --- a/addons/movement/functions/fnc_getWeight.sqf +++ b/addons/movement/functions/fnc_getWeight.sqf @@ -9,7 +9,7 @@ * The return value * * Example: - * _bool = [player] call ace_movement_fnc_getWeight + * [player] call ace_movement_fnc_getWeight * * Public: No */ diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index f0a9bb89d4..6a7db7d5ac 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -27,7 +27,7 @@ "\A3\Ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa" \ ] -private ["_height", "_position", "_color", "_name", "_rank", "_size"]; +private ["_height", "_position", "_color", "_name", "_rank", "_size", "_icon"]; PARAMS_5(_player,_target,_alpha,_heightOffset,_iconType); diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index daddd36c05..c6087541a8 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -55,6 +55,7 @@ if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { //Note: class RscDisplayVoiceChat {idd = 55} - only present when talking [{ + private ["_oldSetting", "_newSetting"]; _oldSetting = ACE_player getVariable [QGVAR(isSpeakingInGame), false]; _newSetting = (!(isNull findDisplay 55)); if (!(_oldSetting isEqualTo _newSetting)) then { diff --git a/addons/nametags/functions/fnc_moduleNameTags.sqf b/addons/nametags/functions/fnc_moduleNameTags.sqf index 6050b99c67..1bbd4d8efb 100644 --- a/addons/nametags/functions/fnc_moduleNameTags.sqf +++ b/addons/nametags/functions/fnc_moduleNameTags.sqf @@ -14,9 +14,7 @@ if !(isServer) exitWith {}; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index d35cef0d67..9efc70aeb9 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -1,9 +1,9 @@ #include "script_component.hpp" -_player = ACE_player; +private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target"]; //don't show nametags in spectator -if (!alive _player) exitWith {}; +if (!alive ACE_player) exitWith {}; _onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then { 2 + (GVAR(ShowNamesTime) - time); //after release 1 second of full opacity, 1 second of fading to 0 @@ -24,14 +24,14 @@ if (GVAR(showCursorTagForVehicles) && {_onKeyPressAlphaMax > 0}) then { if ((!(_target isKindOf "CAManBase")) && {!(_target in allUnitsUAV)}) then { _target = effectiveCommander _target; if ((!isNull _target) && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - _distance = _player distance _target; + _distance = ACE_player distance _target; _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); _alpha = _alpha min _onKeyPressAlphaMax; - [_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon); }; }; }; @@ -41,11 +41,11 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then { _target = cursorTarget; if ((!isNull _target) && {_target isKindOf "CAManBase"} && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - _distance = _player distance _target; + _distance = ACE_player distance _target; _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); _alpha = _alpha min _onKeyPressAlphaMax; _icon = ICON_NONE; @@ -55,7 +55,7 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then { _icon = if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target} && {GVAR(showSoundWaves) > 0}) then {ICON_NAME_SPEAK} else {_defaultIcon}; }; - [_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); }; }; @@ -84,12 +84,12 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho }; if ((_icon != ICON_NONE) && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle _player, _target]) exitWith {}; // Check if there is line of sight + if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle ACE_player, _target]) exitWith {}; // Check if there is line of sight _relPos = (visiblePositionASL _target) vectorDiff _pos; _distance = vectorMagnitude _relPos; _projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy)); @@ -102,7 +102,7 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho _alpha = _alpha min _onKeyPressAlphaMax; }; - [_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); }; } forEach _targets; }; diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 376059ce1b..db5d395096 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -42,7 +42,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if ((currentVisionMode _player != 1)) exitWith {false}; + if ((currentVisionMode ACE_player != 1)) exitWith {false}; // Statement [ACE_player, 1] call FUNC(changeNVGBrightness); @@ -56,7 +56,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if ((currentVisionMode _player != 1)) exitWith {false}; + if ((currentVisionMode ACE_player != 1)) exitWith {false}; // Statement [ACE_player, -1] call FUNC(changeNVGBrightness); diff --git a/addons/nightvision/functions/fnc_updatePPEffects.sqf b/addons/nightvision/functions/fnc_updatePPEffects.sqf index a90186fe10..9906a440fc 100644 --- a/addons/nightvision/functions/fnc_updatePPEffects.sqf +++ b/addons/nightvision/functions/fnc_updatePPEffects.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"]; +private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config", "_hmd", "_cameraView", "_turret"]; _currentVehicle = vehicle ACE_player; @@ -41,7 +41,7 @@ _fnc_isUsingHMD = { !("NVG" in getArray (_config >> "ViewOptics" >> "visionMode")); }; - private ["_result", "_turretConfig", "_turretConfigOpticsIn"]; + private ["_result", "_turretConfig", "_turretConfigOpticsIn", "_index"]; _result = true; _turretConfig = [_config, _turret] call EFUNC(common,getTurretConfigPath); _turretConfigOpticsIn = _turretConfig >> "OpticsIn"; diff --git a/addons/noradio/XEH_post_initClient.sqf b/addons/noradio/XEH_post_initClient.sqf index 4f35a1ced9..ecd80a6436 100644 --- a/addons/noradio/XEH_post_initClient.sqf +++ b/addons/noradio/XEH_post_initClient.sqf @@ -2,15 +2,13 @@ #include "script_component.hpp" /* -_setupPlayer = { +[{ if (!isNull ACE_player) then { [(_this select 1)] call cba_fnc_removePerFrameHandler; [ACE_player, "isPlayer"] call EFUNC(common,muteUnit); }; -}; - -[_setupPlayer, 0, []] call CBA_fnc_addPerFrameHandler; +}, 0, []] call CBA_fnc_addPerFrameHandler; */ if (!hasInterface) exitWith {}; diff --git a/addons/switchunits/functions/fnc_addMapFunction.sqf b/addons/switchunits/functions/fnc_addMapFunction.sqf index 62a7c42a22..7204e73d36 100644 --- a/addons/switchunits/functions/fnc_addMapFunction.sqf +++ b/addons/switchunits/functions/fnc_addMapFunction.sqf @@ -17,12 +17,10 @@ #include "script_component.hpp" -private ["_unit", "_sides"]; -_unit = _this select 0; -_sides = _this select 1; +PARAMS_2(_unit,_sides); ["theMapClick", "onMapSingleClick", { - + // IGNORE_PRIVATE_WARNING(_pos,_shift,_alt) if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then { [_this, _pos, _shift, _alt] call FUNC(handleMapClick); }; diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf index 3033071984..bfe36f13ea 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_unit, _sides] call FUNC(handleMapClick) + * [unit, _sides] call FUNC(handleMapClick) * * Public: No */ diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index 9c71f8cefc..c2857f1091 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_player, _sides] call FUNC(initPlayer) + * [player, [west]] call FUNC(initPlayer) * * Public: No */ @@ -19,8 +19,7 @@ private ["_playerUnit", "_sides"]; -_playerUnit = _this select 0; -_sides = _this select 1; +PARAMS_2(_playerUnit,_sides); if (vehicle _playerUnit == _playerUnit) then { diff --git a/addons/switchunits/functions/fnc_nearestPlayers.sqf b/addons/switchunits/functions/fnc_nearestPlayers.sqf index b79c54054f..987c4e3528 100644 --- a/addons/switchunits/functions/fnc_nearestPlayers.sqf +++ b/addons/switchunits/functions/fnc_nearestPlayers.sqf @@ -10,14 +10,15 @@ * Player units > * * Example: - * [_pos, 100] call FUNC(nearestPlayers) + * [[300,300,0], 100] call FUNC(nearestPlayers) * * Public: Yes */ - #include "script_component.hpp" -private ["_position", "_radius", "_nearestPlayers"]; +private ["_nearestPlayers"]; + +PARAMS_2(_position,_radius); _position = _this select 0; _radius = _this select 1; @@ -25,9 +26,9 @@ _radius = _this select 1; _nearestPlayers = []; { - if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then { - _nearestPlayers pushBack _x; - }; + if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then { + _nearestPlayers pushBack _x; + }; } forEach (nearestObjects [_position, ["Man"], _radius]); - _nearestPlayers +_nearestPlayers diff --git a/addons/switchunits/functions/fnc_switchBack.sqf b/addons/switchunits/functions/fnc_switchBack.sqf index d54713bbe4..9a5253cb3d 100644 --- a/addons/switchunits/functions/fnc_switchBack.sqf +++ b/addons/switchunits/functions/fnc_switchBack.sqf @@ -10,26 +10,20 @@ * None * * Example: - * [_origPlayer, _respPlayer] call FUNC(switchBack) + * [_originalPlayerUnit, _currentUnit] call FUNC(switchBack) * * Public: Yes */ #include "script_component.hpp" -private ["_origPlayerUnit"]; +PARMAS_1(_originalPlayerUnit); -_origPlayerUnit = _this select 0; -[_origPlayerUnit] joinSilent GVAR(OriginalGroup); +[_originalPlayerUnit] joinSilent GVAR(OriginalGroup); DFUNC(pfhSwitchBack) = { - - private ["_args", "_originalPlayerUnit", "_currentUnit"]; - - _args = _this select 0; - - _originalPlayerUnit = _args select 0; - _currentUnit = _args select 1; + PARAMS_2(_args,_pfID); + EXPLODE_2_PVT(_args,_originalPlayerUnit,_currentUnit); if (local _originalPlayerUnit) exitWith { selectPlayer _originalPlayerUnit; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index abd053ffae..b1879b0999 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -18,9 +18,9 @@ #include "script_component.hpp" -private ["_unit", "_allNearestPlayers", "_oldUnit", "_leave"]; +private ["_nearestEnemyPlayers", "_allNearestPlayers", "_oldUnit", "_leave"]; -_unit = _this select 1; +PARAMS_1(_unit); // don't switch to original player units if (!([_unit] call FUNC(isValidAi))) exitWith {}; diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index feed42e3ab..ede20e3196 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -37,6 +37,7 @@ if (!isServer) exitWith {}; }; { + private "_unit"; _unit = _x; if (_unit isKindOf "CAManBase") then { { diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 55fee28cc6..65c3068dce 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -21,6 +21,7 @@ PARAMS_2(_unit,_container); //Only check for player: if (_unit != ace_player) exitWith {false}; +private "_handeled"; _handeled = false; if (GVAR(LockVehicleInventory) && //if setting not enabled diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 790dfe7a99..4c5216c2f6 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -26,6 +26,7 @@ GVAR(CurrentGrenadeMuzzleOther) = ""; // Collect frag and other muzzles separately with uiNamespace do { + private ["_magazines", "_magazine", "_ammo", "_explosive"]; if (isNil QGVAR(FragMuzzles)) then { GVAR(FragMuzzles) = []; GVAR(NonFragMuzzles) = []; diff --git a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf index f73f2444c4..f45ed0ea57 100644 --- a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf @@ -12,18 +12,13 @@ */ #include "script_component.hpp" -private ["_unit", "_muzzle"]; +PARAMS_2(_unit,_muzzle); -_unit = _this select 0; -_muzzle = _this select 1; - -private ["_uniformMags", "_vestMags", "_backPackMags"]; +private ["_uniformMags", "_vestMags", "_backpackMags", "_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; -_backPackMags = getMagazineCargo backpackContainer _unit; - -private ["_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; +_backpackMags = getMagazineCargo backpackContainer _unit; _numberOfMagazines = 0; _magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines"); diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index 1922ffdbb9..d7a68e7f50 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -21,10 +21,10 @@ _numberofMagazines = _this select 1; private ["_color", "_name", "_text", "_picture"]; -_color = [[1,0,0], [1,1,1]] select (_numberOfMagazines > 0); +_color = [[1,0,0], [1,1,1]] select (_numberofMagazines > 0); _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); -_text = [format["%1 x%2", _name, _numberOfMagazines], _color] call EFUNC(common,stringToColoredText); +_text = [format["%1 x%2", _name, _numberofMagazines], _color] call EFUNC(common,stringToColoredText); _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); [_text, _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf index 31999ad0b9..a75a11c202 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf @@ -11,41 +11,41 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_text", "_nextMuzzle"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; if (_nextMuzzle in GVAR(FragMuzzles)) then { - GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; - GVAR(CurrentGrenadeMuzzleIsFrag) = true; + GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleIsFrag) = true; } else { - GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; - GVAR(CurrentGrenadeMuzzleIsFrag) = false; + GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleIsFrag) = false; }; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf index 408cf0e608..0dee3e5c57 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf @@ -11,34 +11,34 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_text", "_nextMuzzle"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleFrag) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleFrag) = ""; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; GVAR(CurrentGrenadeMuzzleIsFrag) = true; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf index c732010a2b..4ab65e5bf3 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf @@ -11,34 +11,34 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_nextMuzzle", "_text"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleOther) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleOther) = ""; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; GVAR(CurrentGrenadeMuzzleIsFrag) = false; diff --git a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf index ced1fa87b3..81d1a59ed1 100644 --- a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf @@ -17,19 +17,15 @@ private ["_unit", "_muzzle"]; _unit = _this select 0; _muzzle = _this select 1; -private ["_uniformMags", "_vestMags", "_backPackMags"]; +private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"]; _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; -_backPackMags = getMagazineCargo backpackContainer _unit; - -private ["_uniformMagsToRemove", "_vestMagsToRemove", "_backPackMagsToRemove"]; +_backpackMags = getMagazineCargo backpackContainer _unit; _uniformMagsToRemove = []; _vestMagsToRemove = []; -_backPackMagsToRemove = []; - -private ["_firstMagazine", "_throwMuzzleNames"]; +_backpackMagsToRemove = []; _firstMagazine = ""; _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); @@ -99,7 +95,7 @@ _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles" for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { _unit removeItem (_x select 0); }; -} forEach _backPackMagsToRemove; +} forEach _backpackMagsToRemove; // Readd magazines { @@ -118,4 +114,4 @@ _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles" for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { _unit addItemToBackpack (_x select 0); }; -} forEach _backPackMagsToRemove; +} forEach _backpackMagsToRemove; diff --git a/tools/search_privates.py b/tools/search_privates.py index 404c56f4db..56626c5bfd 100644 --- a/tools/search_privates.py +++ b/tools/search_privates.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 import fnmatch import os @@ -21,7 +21,7 @@ def get_private_declare(content): priv_split = sorted(set(priv_split)) priv_declared += priv_split; - srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*') + srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*|IGNORE_PRIVATE_WARNING.*') priv_srch_declared = srch.findall(content) priv_srch_declared = sorted(set(priv_srch_declared)) @@ -37,7 +37,7 @@ def get_private_declare(content): return priv_declared def check_privates(filepath): - + bad_count_file = 0 def pushClosing(t): closingStack.append(closing.expr) closing << Literal( closingFor[t[0]] ) @@ -81,6 +81,9 @@ def check_privates(filepath): print (filepath) for bad_priv in missing: print ('\t' + bad_priv) + bad_count_file = bad_count_file + 1 + + return bad_count_file def main(): @@ -89,6 +92,7 @@ def main(): print("#########################") sqf_list = [] + bad_count = 0 parser = argparse.ArgumentParser() parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") @@ -99,7 +103,10 @@ def main(): sqf_list.append(os.path.join(root, filename)) for filename in sqf_list: - check_privates(filename) + bad_count = bad_count + check_privates(filename) + + + print ("Bad Count {0}".format(bad_count)) if __name__ == "__main__": main()