From caef5c105f9cd290bc1cc34d552d55a2d09c0a70 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 17 Apr 2015 22:40:37 -0500 Subject: [PATCH] More Privates --- addons/goggles/XEH_postInit.sqf | 1 + addons/goggles/functions/fnc_applyDirtEffect.sqf | 2 +- addons/goggles/functions/fnc_clearGlasses.sqf | 3 ++- addons/goggles/functions/fnc_getExplosionIndex.sqf | 2 +- addons/goggles/functions/fnc_isGogglesVisible.sqf | 6 ++++-- addons/hearing/functions/fnc_firedNear.sqf | 2 +- addons/hearing/functions/fnc_moduleHearing.sqf | 3 +-- addons/hearing/functions/fnc_updateVolume.sqf | 2 ++ addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf | 2 ++ addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf | 2 +- addons/logistics_wirecutter/functions/fnc_interactEH.sqf | 2 +- addons/magazinerepack/functions/fnc_getMagazineChildren.sqf | 2 +- .../magazinerepack/functions/fnc_simulateRepackEvents.sqf | 2 +- addons/map/functions/fnc_blueForceTrackingModule.sqf | 4 +--- addons/map/functions/fnc_blueForceTrackingUpdate.sqf | 2 ++ addons/map/functions/fnc_determineMapLight.sqf | 2 +- addons/map/functions/fnc_determineZoom.sqf | 2 +- addons/map/functions/fnc_moduleMap.sqf | 3 +-- addons/overheating/functions/fnc_checkTemperature.sqf | 2 ++ addons/overheating/functions/fnc_displayTemperature.sqf | 2 +- addons/overheating/functions/fnc_overheat.sqf | 5 ++--- addons/reload/functions/fnc_canCheckAmmo.sqf | 2 ++ addons/reload/functions/fnc_displayAmmo.sqf | 2 +- addons/reload/functions/fnc_startLinkingBelt.sqf | 4 ++-- 24 files changed, 35 insertions(+), 26 deletions(-) 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/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/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;