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/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index ee62dfdd66..4fcf4fc055 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -56,6 +56,7 @@ FUNC(CheckGlasses) = { }; player addEventHandler ["Explosion", { + private "_effects"; if (alive ace_player) then { call FUNC(ApplyDirtEffect); if (GETBROKEN) exitWith {}; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index 182ffac910..068f7639d2 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false}; -private "_dirtImage"; +private ["_dirtImage", "_applied", "_effects"]; _effects = GETGLASSES(ace_player); _effects set [DIRT, true]; SETGLASSES(ace_player,_effects); diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf index b70b962940..7fcb05a511 100644 --- a/addons/goggles/functions/fnc_clearGlasses.sqf +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -16,7 +16,8 @@ */ #include "script_component.hpp" -private "_broken"; +private ["_broken", "_effects"]; + _broken = GETBROKEN; _effects = GLASSESDEFAULT; _effects set [BROKEN, _broken]; diff --git a/addons/goggles/functions/fnc_getExplosionIndex.sqf b/addons/goggles/functions/fnc_getExplosionIndex.sqf index 5519bf397c..6e16085b2c 100644 --- a/addons/goggles/functions/fnc_getExplosionIndex.sqf +++ b/addons/goggles/functions/fnc_getExplosionIndex.sqf @@ -9,7 +9,7 @@ * The rating [0-3] * * Example: - * _rating = 0.05 call ace_goggles_fnc_getExplosionIndex; + * 0.05 call ace_goggles_fnc_getExplosionIndex; * * Public: No */ diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 9206965995..253a82f0a3 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -14,8 +14,10 @@ * Public: Yes */ #include "script_component.hpp" -private ["_currentGlasses", "_result", "_unit"]; -_unit = _this select 0; + +PARAMS_1(_unit); + +private ["_currentGlasses", "_result", "_position", "_visible"]; _currentGlasses = goggles _unit; _result = false; 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/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 72776b68c6..7e9472e72a 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -21,7 +21,7 @@ */ #include "script_component.hpp" -private ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_silencer", "_audibleFireCoef", "_loudness", "_strength"]; +private ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_silencer", "_audibleFireCoef", "_loudness", "_strength", "_audibleFire", "_audibleFireTime", "_audibleFireTimeCoef"]; _unit = _this select 0; _firer = _this select 1; diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index d7b43e0092..a560a712a6 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -10,8 +10,7 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index dd51f30e19..a0ca6af457 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -18,6 +18,8 @@ #define STRENGHTODEAFNESS 3 #define MAXDEAFNESS 1.1 +private ["_recoverRate", "_volume"]; + // Exit if combat deafness is disabled if !(GVAR(enableCombatDeafness)) exitWith {}; diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index b5c6664657..6fda0fed10 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -18,6 +18,8 @@ PARAMS_2(_caller,_target); +private ["_onFinish", "_onFailure"]; + if (!(_this call FUNC(canRefuelUAV))) exitWith {}; _onFinish = { diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 5153176de2..0cab7ab461 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" #define SOUND_CLIP_TIME_SPACEING 1.5 -private ["_timeToCut"]; +private ["_timeToCut", "_progressCheck"]; PARAMS_2(_unit,_fenceObject); if (_unit != ACE_player) exitWith {}; diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index ddd180047c..efb8f292c9 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -25,7 +25,7 @@ if (_interactionType != 0) exitWith {}; if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; [{ - private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper"]; + private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper", "_action"]; PARAMS_2(_args,_pfID); EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped); diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index 7a2b81371c..fbd07cf31a 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -28,7 +28,7 @@ _unitMagCounts = []; _xFullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _xClassname >> "count"); //for every partial magazine, that is either in inventory or can be moved there - if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _magazineClassname}}) then { + if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _xClassname}}) then { _index = _unitMagazines find _xClassname; if (_index == -1) then { _unitMagazines pushBack _xClassname; diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index fb37a0dd4e..4ef69044da 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded"]; +private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded", "_swapProgress"]; PARAMS_3(_fullMagazineCount,_arrayOfAmmoCounts,_isBelt); diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index cecfd348d2..c156c9527d 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -14,9 +14,7 @@ if !(hasInterface) 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/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf index 030daeaa36..edbe484f04 100644 --- a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_markerType", "_colour", "_marker"]; + // Delete last set of markers (always) { deleteMarkerLocal _x; diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index fbc847c313..a5168bd8a1 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -15,7 +15,7 @@ EXPLODE_1_PVT(_this,_unit); -private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight"]; +private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight", "_flareTint", "_lightTint", "_l"]; // Blend two colors _fnc_blendColor = { diff --git a/addons/map/functions/fnc_determineZoom.sqf b/addons/map/functions/fnc_determineZoom.sqf index fdc620b417..345fc68583 100644 --- a/addons/map/functions/fnc_determineZoom.sqf +++ b/addons/map/functions/fnc_determineZoom.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -private ["_grids", "_fourSize", "_sixSize", "_continue", "_size"]; +private ["_grids", "_fourSize", "_sixSize", "_continue", "_size", "_i"]; _grids = configFile >> "CfgWorlds" >> worldName >> "Grid"; _fourSize = -1; _sixSize = -1; diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index a22bbbb385..4bcdb69269 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -10,8 +10,7 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 26fb005e9f..8129a75b15 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -24,6 +24,7 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; // The thread dies as soon as the mission start, so it's not really compiting for scheduler space. [] spawn { _fnc_installMapEvents = { + private "_d"; _d = _this; ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; diff --git a/addons/maptools/functions/fnc_addLineMarker.sqf b/addons/maptools/functions/fnc_addLineMarker.sqf index 83e983d0e3..157891a262 100644 --- a/addons/maptools/functions/fnc_addLineMarker.sqf +++ b/addons/maptools/functions/fnc_addLineMarker.sqf @@ -15,10 +15,11 @@ */ #include "script_component.hpp" -_name = _this select 0; -_startPos = _this select 1; -_difPos = (_this select 2) vectorDiff _startPos ; -_color = _this select 3; +PARAMS_4(_name,_startPos,_endPos,_color); + +private ["_marker", "_difPos", "_mag"]; + +_difPos = _endPos vectorDiff _startPos; _marker = createMarkerLocal [_name, _startPos]; _name setMarkerShapeLocal "RECTANGLE"; diff --git a/addons/maptools/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf index 700e089a88..4723a4f5e1 100644 --- a/addons/maptools/functions/fnc_calculateMapScale.sqf +++ b/addons/maptools/functions/fnc_calculateMapScale.sqf @@ -12,6 +12,8 @@ */ #include "script_component.hpp" +private ["_screenOffset", "_pos"]; + _pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5]; _screenOffset = ((finddisplay 12) displayctrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)]; diff --git a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf index e3de77316a..44f6ed6203 100644 --- a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf +++ b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf @@ -15,6 +15,7 @@ PARAMS_1(_lineMarkers); { + private "_marker"; _marker = _x; //Add marker if we don't already have it if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then { diff --git a/addons/maptools/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf index d2b3a060b8..d1f9e199c9 100644 --- a/addons/maptools/functions/fnc_handleKeyDown.sqf +++ b/addons/maptools/functions/fnc_handleKeyDown.sqf @@ -15,13 +15,10 @@ #include "script_component.hpp" -private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; +PARAMS_5(_display,_code,_shiftKey,_ctrlKey,_altKey); + +private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"]; -_display = _this select 0; -_code = _this select 1; -_shiftKey = _this select 2; -_ctrlKey = _this select 3; -_altKey = _this select 4; _handled = false; #define DIK_ESCAPE 0x01 diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 8db6b8b0f1..16cabe9719 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -13,10 +13,9 @@ #include "script_component.hpp" -private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; +private ["_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos", "_altKey", "_gui", "_marker"]; -_dir = _this select 0; -_params = _this select 1; +PARAMS_2(_dir,_params); _control = _params select 0; _button = _params select 1; _screenPos = [_params select 2, _params select 3]; diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 4111c8fad4..2148c5a162 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -51,6 +51,7 @@ if (GVAR(mapTool_isDragging)) exitWith { // Rotation if (GVAR(mapTool_isRotating)) exitWith { + private "_angle"; // Get new angle _angle = (180 + ((GVAR(mousePosition) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mousePosition) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360); GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle); diff --git a/addons/maptools/functions/fnc_isInsideMapTool.sqf b/addons/maptools/functions/fnc_isInsideMapTool.sqf index 4dd66e2b9a..eeaf8f346a 100644 --- a/addons/maptools/functions/fnc_isInsideMapTool.sqf +++ b/addons/maptools/functions/fnc_isInsideMapTool.sqf @@ -16,6 +16,7 @@ #define DIST_TOP_TO_CENTER_PERC 0.65 #define DIST_LEFT_TO_CENTER_PERC 0.30 +private ["_textureWidth", "_relPos", "_dirVector", "_lambdaLong", "_lambdaTrasAbs", "_pos"]; if (GVAR(mapTool_Shown) == 0) exitWith {false}; _textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1); diff --git a/addons/maptools/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf index c4e2436b3b..7d29d9e169 100644 --- a/addons/maptools/functions/fnc_openMapGps.sqf +++ b/addons/maptools/functions/fnc_openMapGps.sqf @@ -12,7 +12,10 @@ */ #include "script_component.hpp" -_shouldOpenGps = _this select 0; +PARAMS_1(_shouldOpenGps); + +private ["_isOpen"]; + _isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])); if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then { diff --git a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf index ddc177f182..092f0720c2 100644 --- a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf +++ b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf @@ -3,6 +3,8 @@ #include "script_component.hpp" +private ["_mapGpsDisplay", "_ctrl"]; + if ((!("ItemGPS" in assigneditems ACE_player)) || {isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])}) exitWith { ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC [(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler diff --git a/addons/maptools/functions/fnc_removeLineMarker.sqf b/addons/maptools/functions/fnc_removeLineMarker.sqf index 45c39611db..be82970524 100644 --- a/addons/maptools/functions/fnc_removeLineMarker.sqf +++ b/addons/maptools/functions/fnc_removeLineMarker.sqf @@ -11,7 +11,7 @@ #include "script_component.hpp" -_name = _this select 0; +PARAMS_1(_name); deleteMarkerLocal _name; { diff --git a/addons/maptools/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf index cf80c1ac26..a745bfa123 100644 --- a/addons/maptools/functions/fnc_updateLineMarker.sqf +++ b/addons/maptools/functions/fnc_updateLineMarker.sqf @@ -13,10 +13,11 @@ */ #include "script_component.hpp" -_name = _this select 0; -_startPos = _this select 1; -_difPos = (_this select 2) vectorDiff _startPos ; -_color = _this select 3; +PARAMS_4(_name,_startPos,_endPos,_color); + +private ["_difPos", "_mag"]; + +_difPos = _endPos vectorDiff _startPos; _name setMarkerShapeLocal "RECTANGLE"; _name setMarkerAlphaLocal 1; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 3a7b919b8b..fa6db8872a 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -18,6 +18,8 @@ PARAMS_1(_theMap); +private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"]; + if (!("ACE_MapTools" in items ACE_player)|| {GVAR(mapTool_Shown) == 0}) exitWith {}; _rotatingTexture = ""; 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/overheating/functions/fnc_checkTemperature.sqf b/addons/overheating/functions/fnc_checkTemperature.sqf index 6c15068815..0b811f9792 100644 --- a/addons/overheating/functions/fnc_checkTemperature.sqf +++ b/addons/overheating/functions/fnc_checkTemperature.sqf @@ -18,6 +18,8 @@ EXPLODE_2_PVT(_this,_player,_weapon); +private ["_action"]; + // Play animation and report temperature _action = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_checkTemperatureAction"); diff --git a/addons/overheating/functions/fnc_displayTemperature.sqf b/addons/overheating/functions/fnc_displayTemperature.sqf index 6112bea178..3012e480e3 100644 --- a/addons/overheating/functions/fnc_displayTemperature.sqf +++ b/addons/overheating/functions/fnc_displayTemperature.sqf @@ -16,7 +16,7 @@ EXPLODE_2_PVT(_this,_player,_weapon); // Calculate cool down of weapon since last shot -private ["_string", "_overheat", "_temperature", "_time", "_barrelMass"]; +private ["_string", "_overheat", "_temperature", "_time", "_barrelMass", "_a"]; _string = format [QGVAR(%1), _weapon]; _overheat = _player getVariable [_string, [0, 0]]; _temperature = _overheat select 0; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index 2468265f8f..05e5bbba9c 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -17,7 +17,8 @@ */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_unit", "_weapon", "_ammo", "_projectile"]; +private ["_unit", "_weapon", "_ammo", "_projectile", "_velocity", "_variableName", "_overheat", "_temperature", "_time", "_bulletMass", "_energyIncrement", "_barrelMass", "_scaledTemperature", "_intensity", "_position", "_direction", "_dispersion", "_count", "_slowdownFactor", "_jamChance", "_surface"]; + _unit = _this select 0; _weapon = _this select 1; _ammo = _this select 4; @@ -25,8 +26,6 @@ _projectile = _this select 6; _velocity = velocity _projectile; -private ["_variableName", "_overheat", "_temperature", "_time", "_energyIncrement", "_barrelMass", "_scaledTemperature"]; - // each weapon has it's own variable. Can't store the temperature in the weapon since they are not objects unfortunately. _variableName = format [QGVAR(%1), _weapon]; diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 63c302bf07..4075e7a151 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -13,6 +13,8 @@ EXPLODE_2_PVT(_this,_player,_target); +private ["_magazineType", "_magazineCfg"]; + // Return true for static weapons if they have been fired once, @todo 1.40 this work-around doesn't work anymore if (_target isKindOf "StaticWeapon") exitWith { if (currentMagazine _target != "") exitWith {true}; diff --git a/addons/reload/functions/fnc_displayAmmo.sqf b/addons/reload/functions/fnc_displayAmmo.sqf index 77578caa68..06f3a39da3 100644 --- a/addons/reload/functions/fnc_displayAmmo.sqf +++ b/addons/reload/functions/fnc_displayAmmo.sqf @@ -14,7 +14,7 @@ EXPLODE_1_PVT(_this,_target); -private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture"]; +private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture", "_a", "_string"]; _weapon = currentWeapon _target; _muzzle = currentMuzzle _target; diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index 412fcabb97..8b9145c237 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -15,7 +15,7 @@ EXPLODE_2_PVT(_this,_player,_target); if (vehicle _target != _target) exitWith {false}; -private ["_magazineCfg","_magazineType"]; +private ["_magazineCfg","_magazineType", "_condition", "_onFailure", "_onFinish"]; _magazineType = currentMagazine _target; _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; @@ -54,7 +54,7 @@ _onFinish = { _onFailure = { EXPLODE_3_PVT((_this select 0),_player,_target,_magazine); - [_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + [_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); // Add back the magazine with the former ammo count _player addMagazine _magazine; diff --git a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf index 36772f9dfd..fc802a025c 100644 --- a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf +++ b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf @@ -14,12 +14,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_magazine"]; - -_unit = _this select 0; -_target = _this select 1; -_weapon = _this select 2; -_magazine = _this select 3; +PARAMS_4(_unit,_target,_weapon,_magazine); _target selectWeapon _weapon; diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf index f8a0479717..914334cc25 100644 --- a/addons/respawn/functions/fnc_handleInitPostServer.sqf +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -2,13 +2,11 @@ // execute on server only! #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); private ["_group0", "_rallypoint"]; -_group0 = group _unit; // _group is a reserved veriable and shouldn't be used +_group0 = group _unit; // _group-is a reserved veriable and shouldn't be used _rallypoint = [ objNull, diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index 44671b7c45..2ef158a419 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -16,11 +16,7 @@ #include "script_component.hpp" -private ["_rallypoint", "_respawnMarker", "_side"]; - -_rallypoint = _this select 0; -_respawnMarker = _this select 1; -_side = _this select 2; +PARAMS_3(_rallypoint,_respawnMarker,_side); private "_name"; _name = typeOf _rallypoint; @@ -29,12 +25,11 @@ _name = typeOf _rallypoint; if (hasInterface) then { // fix init having wrong position, vars etc. [_rallypoint, _respawnMarker, _side, _name] spawn { - _rallypoint = _this select 0; - _respawnMarker = _this select 1; - _side = _this select 2; - _name = _this select 3; - - _marker = format ["ACE_Marker_%1", _name]; + PARAMS_4(_rallypoint,_respawnMarker,_side,_name); + + private ["_marker", "_type"]; + + _marker = format ["ACE_Marker_%1", _name]; // exit if it already exist if (_marker in allMapMarkers) exitWith {}; diff --git a/addons/respawn/functions/fnc_module.sqf b/addons/respawn/functions/fnc_module.sqf index 6d03c1eda3..4f22bdfcd4 100644 --- a/addons/respawn/functions/fnc_module.sqf +++ b/addons/respawn/functions/fnc_module.sqf @@ -18,10 +18,9 @@ #include "script_component.hpp" -if !(isServer) exitWith {}; +PARAMS_3(_logic,_units,_activated); -_logic = _this select 0; -_activated = _this select 2; +if !(isServer) exitWith {}; if !(_activated) exitWith {}; @@ -32,9 +31,10 @@ GVAR(Module) = true; if (isServer) then { if (GVAR(RemoveDeadBodiesDisconnected)) then { + private "_fnc_deleteDisconnected"; _fnc_deleteDisconnected = { _this spawn { - _unit = _this select 0; + PARAMS_1(_unit); sleep 4; diff --git a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf index 35857b43e4..7641db806d 100644 --- a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf +++ b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf @@ -19,17 +19,13 @@ #include "script_component.hpp" _this spawn { - _logic = _this select 0; - _units = _this select 1; - _activated = _this select 2; + PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; if (isServer) then { - _varName = QGVAR(showFriendlyFireMessage); - - missionNamespace setVariable [_varName, true]; - publicVariable _varName; + missionNamespace setVariable [QGVAR(showFriendlyFireMessage), true]; + publicVariable QGVAR(showFriendlyFireMessage); }; diag_log text "[ACE]: Friendly Fire Messages Module Initialized."; diff --git a/addons/respawn/functions/fnc_moduleRallypoint.sqf b/addons/respawn/functions/fnc_moduleRallypoint.sqf index 1646fa72da..15c415027d 100644 --- a/addons/respawn/functions/fnc_moduleRallypoint.sqf +++ b/addons/respawn/functions/fnc_moduleRallypoint.sqf @@ -16,11 +16,9 @@ VOID */ - #include "script_component.hpp" - -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +#include "script_component.hpp" + +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index 62d2742ef9..2453c68344 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -18,9 +18,10 @@ #include "script_component.hpp" _this spawn { - _unit = _this select 0; - _side = _this select 1; - + PARAMS_2(_unit,_side); + + private ["_rallypoint", "_position"]; + // rallypoint names are defined in CfgVehicles.hpp _rallypoint = [ diff --git a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf index 492cd990a4..7bd0a6707f 100644 --- a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf +++ b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_forceRemove", "_body"]; +private ["_forceRemove", "_body", "_uid"]; _forceRemove = _this select 0; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index 5a00e3425c..85863bb6c2 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -17,11 +17,10 @@ #include "script_component.hpp" -private ["_unit", "_allGear", "_headgear", "_goggles", "_uniform", "_uniformitems", "_vest", "_vestitems", "_backpack", "_backpackitems", "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", "_assigneditems", "_binocular"]; +PARAMS_2(_unit,_allGear); +private ["_unit", "_allGear", "_headgear", "_goggles", "_uniform", "_uniformitems", "_vest", "_vestitems", "_backpack", "_backpackitems", "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", "_assigneditems", "_binocular", "_backpa", "_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine"]; -_unit = _this select 0; -_allGear = _this select 1; // remove all starting gear of a player removeAllWeapons _unit; diff --git a/addons/respawn/functions/fnc_teleportToRallypoint.sqf b/addons/respawn/functions/fnc_teleportToRallypoint.sqf index 82a1d68e05..dc3cc16b92 100644 --- a/addons/respawn/functions/fnc_teleportToRallypoint.sqf +++ b/addons/respawn/functions/fnc_teleportToRallypoint.sqf @@ -1,31 +1,29 @@ /* - Name: ACE_Respawn_fnc_teleportToRallypoint - - Author(s): - commy2 - - Description: - teleports a unit to a rallypoint - - Parameters: - 0: OBJECT - unit - 1: OBJECT - side - 2: BOOLEAN - teleport to base - - Returns: - VOID -*/ - + * Author: commy2 + * teleports a unit to a rallypoint + * + * Arguments: + * 0: unit + * 1: side? + * 2: teleport to base + * + * Return Value: + * Nothing + * + * Example: + * [,,] call ACE_Respawn_fnc_teleportToRallypoint; + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_side", "_rallypoint", "_toBase"]; +PARAMS_3(_unit,_side,_rallypoint); -_unit = _this select 0; -_side = _this select 1; -_rallypoint = _this select 2; +private ["_toBase"]; // rallypoint names are defined in CfgVehicles.hpp +//IGNORE_PRIVATE_WARNING("_Base") _toBase = _rallypoint find "_Base" != -1; _rallypoint = missionNamespace getVariable [_rallypoint, objNull], diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index aa13029547..be6b79d82a 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -3,6 +3,7 @@ if (!hasInterface) exitWith {}; +// IGNORE_PRIVATE_WARNING(_player) //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index 76c62a4688..a59095d127 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -14,11 +14,11 @@ */ #include "script_component.hpp" -if !(vehicle _unit == _unit) exitWith {false}; +PARAMS_3(_unit,_turretAndDirection,_majorStep); -private ["_unit", "_turretAndDirection", "_majorStep", "_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero"]; +if (vehicle _unit != _unit) exitWith {false}; -EXPLODE_3_PVT(_this,_unit,_turretAndDirection,_majorStep); +private ["_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero", "_adjustment"]; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/functions/fnc_adjustZero.sqf b/addons/scopes/functions/fnc_adjustZero.sqf index 4dbab48f49..12e911b537 100644 --- a/addons/scopes/functions/fnc_adjustZero.sqf +++ b/addons/scopes/functions/fnc_adjustZero.sqf @@ -12,10 +12,11 @@ */ #include "script_component.hpp" -if !(vehicle _unit == _unit) exitWith {false}; +PARAMS_1(_unit); -private ["_unit", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"]; -_unit = _this select 0; +if (vehicle _unit != _unit) exitWith {false}; + +private ["_weaponIndex", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"]; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index 6bb72558b1..4950fe9ece 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -15,10 +15,10 @@ */ #include "script_component.hpp" -private ["_unit", "_elevation", "_windage", "_zero", "_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw"]; - EXPLODE_4_PVT(_this,_unit,_elevation,_windage,_zero); +private ["_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_adjustment", "_weaponIndex"]; + _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); _adjustment = _unit getVariable QGVAR(Adjustment); diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index c9663ea711..619d82cf6e 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -12,13 +12,14 @@ */ #include "script_component.hpp" +PARAMS_1(_unit); + +private ["_weaponIndex", "_adjustment", "_elevation"]; + if (cameraView == "GUNNER") exitWith {false}; if !(vehicle _unit == _unit) exitWith {false}; if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; -private ["_unit", "_adjustment", "_elevation"]; -_unit = _this select 0; - _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; 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..69be77dd8b 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"]; +PARAMS_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..4b418de8d6 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]] ) @@ -70,17 +70,22 @@ def check_privates(filepath): if '_forEachIndex' in priv_use: priv_use.remove('_forEachIndex') if '_foreachIndex' in priv_declared: priv_declared.remove('_foreachIndex') if '_foreachIndex' in priv_use: priv_use.remove('_foreachIndex') + if '_foreachindex' in priv_declared: priv_declared.remove('_foreachindex') + if '_foreachindex' in priv_use: priv_use.remove('_foreachindex') missing = [] for s in priv_use: - if s not in priv_declared: - if s not in missing: + if s.lower() not in map(str.lower,priv_declared): + if s.lower() not in map(str.lower,missing): missing.append(s) if len(missing) > 0: 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 +94,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 +105,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()