From b489750d5b1276753c65f46c9e2c6062b61cc6fd Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 4 Sep 2016 16:44:22 +0200 Subject: [PATCH] Minor optimizations using private, params, and isEqualType (#4323) * Optimizations with private, params, and isEqualType * Fixed tab being used instead of space * Fixed tabs inserted by notepad++ * More usage of new private syntax and params - changed a few checks for an array being empty to `_arr isEqualTo []` rather than `count _arr == 0` - added more uses of `private` on the same line as the variable is declared - added more uses of params to assign variables passed as parameters - removed unnecessary parentheses - removed several unnecessary variable declarations with private array syntax * clean up and formatting --- ..._calculateAmmoTemperatureVelocityShift.sqf | 14 ++- .../fnc_calculateAtmosphericCorrection.sqf | 4 +- .../fnc_calculateStabilityFactor.sqf | 7 +- .../functions/fnc_handleFirePFH.sqf | 9 +- .../fnc_readWeaponDataFromConfig.sqf | 11 +-- addons/atragmx/functions/fnc_add_new_gun.sqf | 6 +- .../functions/fnc_calculate_range_card.sqf | 63 ++++++------ .../fnc_calculate_target_range_assist.sqf | 10 +- .../functions/fnc_change_target_slot.sqf | 3 +- addons/atragmx/functions/fnc_delete_gun.sqf | 3 +- .../fnc_target_speed_assist_timer.sqf | 5 +- addons/attach/functions/fnc_attach.sqf | 2 +- addons/attach/functions/fnc_handleGetIn.sqf | 6 +- addons/attach/functions/fnc_handleGetOut.sqf | 6 +- addons/attach/functions/fnc_handleKilled.sqf | 6 +- addons/ballistics/scripts/initTargetWall.sqf | 4 +- addons/captives/XEH_postInit.sqf | 3 +- .../captives/functions/fnc_canSurrender.sqf | 4 +- .../functions/fnc_canUnloadCaptive.sqf | 2 - .../captives/functions/fnc_doFriskPerson.sqf | 13 +-- .../captives/functions/fnc_handleGetOut.sqf | 4 +- .../captives/functions/fnc_handleRespawn.sqf | 3 +- .../functions/fnc_vehicleCaptiveMoveIn.sqf | 4 +- addons/cargo/functions/fnc_initVehicle.sqf | 5 +- .../fnc_actionKeysNamesConverted.sqf | 2 +- addons/common/functions/fnc_displayIcon.sqf | 4 +- addons/common/functions/fnc_getInPosition.sqf | 3 +- .../functions/fnc_unloadPersonLocal.sqf | 3 +- addons/common/scripts/checkVersionNumber.sqf | 2 +- .../concertina_wire/functions/fnc_deploy.sqf | 25 +++-- .../functions/fnc_dismount.sqf | 6 +- .../functions/fnc_handleKilled.sqf | 6 +- .../functions/fnc_vehicleDamage.sqf | 10 +- addons/dagr/functions/fnc_menuInit.sqf | 5 +- addons/dagr/functions/fnc_outputData.sqf | 2 +- addons/dagr/functions/fnc_outputWP.sqf | 2 +- .../functions/fnc_eventTargetStart.sqf | 4 +- .../functions/fnc_getAllGearContainer.sqf | 6 +- .../functions/fnc_openDisarmDialog.sqf | 3 +- .../functions/fnc_showItemsInListbox.sqf | 13 +-- .../functions/fnc_verifyMagazinesMoved.sqf | 8 +- .../functions/fnc_addCellphoneIED.sqf | 2 +- .../functions/fnc_addExplosiveActions.sqf | 8 +- addons/explosives/functions/fnc_dialPhone.sqf | 2 +- .../explosives/functions/fnc_dialingPhone.sqf | 3 +- .../functions/fnc_removeFromSpeedDial.sqf | 4 +- .../functions/fnc_selectTrigger.sqf | 4 +- .../explosives/functions/fnc_setSpeedDial.sqf | 11 +-- .../functions/fnc_setupExplosive.sqf | 4 +- .../explosives/functions/fnc_startDefuse.sqf | 2 +- .../explosives/functions/fnc_triggerType.sqf | 2 +- .../fastroping/functions/fnc_deployRopes.sqf | 23 +++-- .../finger/functions/fnc_incomingFinger.sqf | 2 +- addons/frag/functions/fnc_addBlackList.sqf | 3 +- addons/frag/functions/fnc_addPfhRound.sqf | 2 +- addons/frag/functions/fnc_addTrack.sqf | 15 ++- addons/frag/functions/fnc_doExplosions.sqf | 16 +-- addons/frag/functions/fnc_doReflections.sqf | 12 +-- addons/frag/functions/fnc_doSpall.sqf | 99 +++++++++---------- addons/frag/functions/fnc_findReflections.sqf | 21 ++-- addons/frag/functions/fnc_frago.sqf | 39 ++++---- addons/frag/functions/fnc_masterPFH.sqf | 6 +- addons/frag/functions/fnc_pfhRound.sqf | 2 +- addons/frag/functions/fnc_spallTrack.sqf | 24 ++--- addons/frag/functions/fnc_trackTrace.sqf | 12 +-- .../functions/fnc_renderIcon.sqf | 12 +-- .../functions/fnc_addPassengersActions.sqf | 3 +- addons/interaction/functions/fnc_getDown.sqf | 3 +- addons/interaction/functions/fnc_openDoor.sqf | 9 +- addons/interaction/functions/fnc_sendAway.sqf | 6 +- .../functions/fnc_showMouseHint.sqf | 3 +- addons/javelin/functions/fnc_onFired.sqf | 4 +- addons/javelin/functions/fnc_onOpticDraw.sqf | 34 +++---- .../javelin/functions/fnc_onOpticUnload.sqf | 2 +- .../functions/fnc_buttonPressed.sqf | 3 +- .../kestrel4500/functions/fnc_dayOfWeek.sqf | 3 +- .../functions/fnc_displayKestrel.sqf | 3 +- .../functions/fnc_updateDisplay.sqf | 4 +- .../functions/fnc_updateImpellerState.sqf | 4 +- addons/laser/functions/fnc_checkLos.sqf | 19 ++-- .../laser/functions/fnc_findStrongestRay.sqf | 27 +++-- addons/laser/functions/fnc_handleLaserOff.sqf | 3 +- addons/laser/functions/fnc_handleLaserOn.sqf | 4 +- .../laser/functions/fnc_keyLaserCodeDown.sqf | 2 +- addons/laser/functions/fnc_keyLaserCodeUp.sqf | 2 +- addons/laser/functions/fnc_laserOff.sqf | 3 +- addons/laser/functions/fnc_laserOn.sqf | 5 +- addons/laser/functions/fnc_laserTargetPFH.sqf | 7 +- addons/laser/functions/fnc_laser_init.sqf | 2 +- .../functions/fnc_onLaserDesignatorDraw.sqf | 2 +- addons/laser/functions/fnc_rotateVectLine.sqf | 2 +- .../functions/fnc_seekerFindLaserSpot.sqf | 2 +- .../fnc_vanillaLaserSeekerHandler.sqf | 2 +- .../functions/fnc_findLaserSource.sqf | 2 +- .../functions/fnc_laserHudDesignateOn.sqf | 2 +- addons/laserpointer/XEH_postInit.sqf | 3 +- .../functions/fnc_refuelUAV.sqf | 5 +- .../functions/fnc_getMagazineChildren.sqf | 3 +- .../functions/fnc_drawMapGestures.sqf | 2 +- .../functions/fnc_getProximityPlayers.sqf | 4 +- addons/medical/XEH_postInit.sqf | 7 +- .../medical/functions/fnc_actionDiagnose.sqf | 1 - .../medical/functions/fnc_actionLoadUnit.sqf | 3 +- .../functions/fnc_handleDamage_airway.sqf | 3 +- .../functions/fnc_handleDamage_caching.sqf | 1 - .../fnc_handleDamage_internalInjuries.sqf | 3 +- addons/medical/functions/fnc_handleKilled.sqf | 1 - addons/medical/functions/fnc_handleLocal.sqf | 3 +- .../medical/functions/fnc_isBeingCarried.sqf | 4 +- .../medical/functions/fnc_isBeingDragged.sqf | 4 +- .../functions/fnc_moduleAssignMedicRoles.sqf | 5 +- .../fnc_moduleAssignMedicalVehicle.sqf | 5 +- .../functions/fnc_setCardiacArrest.sqf | 3 +- .../functions/fnc_setStructuralDamage.sqf | 3 +- .../medical/functions/fnc_showBloodEffect.sqf | 3 +- ...eatmentAdvanced_surgicalKit_onProgress.sqf | 4 +- addons/medical/functions/fnc_treatmentIV.sqf | 5 +- .../functions/fnc_updateUIInfo.sqf | 5 +- addons/microdagr/functions/fnc_canShow.sqf | 4 +- .../functions/fnc_deviceAddWaypoint.sqf | 5 +- .../functions/fnc_deviceDeleteWaypoint.sqf | 3 +- .../functions/fnc_mapDoubleTapEH.sqf | 4 +- .../functions/fnc_attackProfile_JAV_DIR.sqf | 22 ++--- .../functions/fnc_attackProfile_JAV_TOP.sqf | 26 ++--- .../functions/fnc_attackProfile_LIN.sqf | 4 +- .../functions/fnc_checkSeekerAngle.sqf | 2 +- .../functions/fnc_doAttackProfile.sqf | 2 +- .../functions/fnc_doSeekerSearch.sqf | 6 +- .../functions/fnc_guidancePFH.sqf | 10 +- .../missileguidance/functions/fnc_onFired.sqf | 4 +- .../functions/fnc_rotateVectLine.sqf | 2 +- .../functions/fnc_seekerType_Optic.sqf | 6 +- .../functions/fnc_seekerType_SALH.sqf | 2 +- .../fnc_handlePlayerVehicleChanged.sqf | 2 +- addons/mk6mortar/functions/fnc_toggleMils.sqf | 4 +- addons/nametags/functions/fnc_doShow.sqf | 2 +- .../nametags/functions/fnc_getVehicleData.sqf | 45 ++++----- addons/nametags/functions/fnc_setText.sqf | 2 +- .../functions/fnc_changeNVGBrightness.sqf | 4 +- addons/optics/functions/fnc_handleFired.sqf | 35 +++---- addons/optics/functions/fnc_onDrawScope.sqf | 12 +-- addons/optics/functions/fnc_onDrawScope2D.sqf | 2 +- .../functions/fnc_moduleAllowConfigExport.sqf | 3 +- .../functions/fnc_onCategorySelectChanged.sqf | 6 +- .../fnc_onListBoxSettingsChanged.sqf | 6 +- .../fnc_onServerSettingsMenuOpen.sqf | 12 +-- .../fnc_canCheckSpareBarrelsTemperatures.sqf | 2 +- .../functions/fnc_canSwapBarrel.sqf | 2 +- addons/overheating/functions/fnc_firedEH.sqf | 4 +- .../overpressure/functions/fnc_firedEHBB.sqf | 2 +- .../overpressure/functions/fnc_firedEHOP.sqf | 2 +- .../functions/fnc_overpressureDamage.sqf | 2 +- .../functions/fnc_checkCutParachute.sqf | 3 +- .../parachute/functions/fnc_cutParachute.sqf | 5 +- .../fnc_handleInfoDisplayChanged.sqf | 8 +- .../parachute/functions/fnc_onEachFrame.sqf | 3 +- addons/rearm/XEH_respawn.sqf | 7 +- .../rearm/functions/fnc_getMaxMagazines.sqf | 3 +- addons/rearm/functions/fnc_grabAmmo.sqf | 3 +- addons/rearm/functions/fnc_pickUpAmmo.sqf | 1 - addons/rearm/functions/fnc_storeAmmo.sqf | 3 +- addons/refuel/XEH_respawn.sqf | 4 +- .../repair/functions/fnc_addRepairActions.sqf | 2 +- .../fnc_getWheelHitPointsWithSelections.sqf | 5 +- addons/repair/functions/fnc_repair.sqf | 7 +- .../functions/fnc_setHitPointDamage.sqf | 2 +- .../functions/fnc_handleInitPostServer.sqf | 3 +- .../functions/fnc_handlePlayerChanged.sqf | 3 +- .../functions/fnc_teleportToRallypoint.sqf | 3 +- .../functions/fnc_setSafeModeVisual.sqf | 6 +- addons/sandbag/functions/fnc_deploy.sqf | 3 +- addons/scopes/functions/fnc_getOptics.sqf | 4 +- addons/scopes/functions/fnc_showZeroing.sqf | 21 ++-- .../functions/fnc_addSlideActions.sqf | 3 +- .../functions/fnc_autoTransition.sqf | 3 +- .../functions/fnc_handleInterface.sqf | 7 +- .../functions/fnc_respawnTemplate.sqf | 5 +- addons/tagging/functions/fnc_tag.sqf | 8 +- addons/trenches/functions/fnc_placeTrench.sqf | 3 +- .../vector/functions/fnc_adjustBrightness.sqf | 8 +- addons/vector/functions/fnc_clearDisplay.sqf | 4 +- .../functions/fnc_convertToTexturesDegree.sqf | 27 +++-- addons/vector/functions/fnc_getDirection.sqf | 10 +- addons/vector/functions/fnc_illuminate.sqf | 16 +-- addons/vector/functions/fnc_onKeyDown.sqf | 3 +- addons/vector/functions/fnc_onKeyHold.sqf | 27 ++--- addons/vector/functions/fnc_onKeyUp.sqf | 3 +- addons/vector/functions/fnc_showAzimuth.sqf | 10 +- .../functions/fnc_showAzimuthInclination.sqf | 10 +- addons/vector/functions/fnc_showDistance.sqf | 10 +- .../vector/functions/fnc_showFallOfShot.sqf | 16 +-- .../functions/fnc_showHeightDistance.sqf | 10 +- addons/vector/functions/fnc_showP1.sqf | 4 +- .../fnc_showRelativeAzimuthDistance.sqf | 10 +- .../functions/fnc_showRelativeDistance.sqf | 10 +- .../fnc_showRelativeHeightLength.sqf | 10 +- addons/vector/functions/fnc_showText.sqf | 4 +- .../vehiclelock/functions/fnc_moduleSync.sqf | 3 +- .../functions/fnc_serverSetupCustomKeyEH.sqf | 4 +- .../functions/fnc_setVehicleLockEH.sqf | 4 +- .../functions/fnc_updateTrajectoryPFH.sqf | 2 +- .../zeus/functions/fnc_bi_moduleCurator.sqf | 11 +-- addons/zeus/functions/fnc_bi_moduleMine.sqf | 4 +- .../functions/fnc_bi_moduleProjectile.sqf | 11 +-- .../functions/fnc_onPrepare.sqf | 5 +- 205 files changed, 589 insertions(+), 904 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index fefdbb16e4..19cd55c98e 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -14,24 +14,22 @@ */ #include "script_component.hpp" -private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction", - "_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"]; -params["_muzzleVelocityShiftTable", "_temperature"]; +params ["_muzzleVelocityShiftTable", "_temperature"]; // Check if muzzleVelocityShiftTable is Less Than 11 Entrys if ((count _muzzleVelocityShiftTable) < 11) exitWith {0}; -_muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; +private _muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 }; // Find exact data index required for given temperature -_temperatureIndexFunction = (_temperature + 15) / 5; +private _temperatureIndexFunction = (_temperature + 15) / 5; // lower and upper data index used for interpolation -_temperatureIndexA = (0 max (floor(_temperatureIndexFunction))) min 10; -_temperatureIndexB = (0 max (ceil(_temperatureIndexFunction))) min 10; +private _temperatureIndexA = (0 max (floor(_temperatureIndexFunction))) min 10; +private _temperatureIndexB = (0 max (ceil(_temperatureIndexFunction))) min 10; // Interpolation ratio -_interpolationRatio = _temperatureIndexFunction - floor(_temperatureIndexFunction); +private _interpolationRatio = _temperatureIndexFunction - floor(_temperatureIndexFunction); // Interpolation (_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _interpolationRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _interpolationRatio // Return diff --git a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf index fac048c061..2b90767a4f 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf @@ -17,11 +17,9 @@ */ #include "script_component.hpp" -private "_airDensity"; - params ["_ballisticCoefficient", "_temperature"/*in C*/, "_pressure"/*in hPa*/, "_relativeHumidity"/*as ratio 0-1*/, "_atmosphereModel"/*"ICAO" or "ASM"*/]; -_airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); +private _airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); if (_atmosphereModel == "ICAO") then { (STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient diff --git a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf index 671ab2ccb0..07fc7c67c9 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf @@ -19,14 +19,13 @@ */ #include "script_component.hpp" -private ["_twist", "_length", "_stabilityFactor"]; params ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure"]; // Source: http://www.jbmballistics.com/ballistics/bibliography/articles/miller_stability_1.pdf -_twist = _barrelTwist / _caliber; -_length = _bulletLength / _caliber; +private _twist = _barrelTwist / _caliber; +private _length = _bulletLength / _caliber; -_stabilityFactor = 7587000 * _bulletMass / (_twist^2 * _caliber^3 * _length * (1 + _length^2)); +private _stabilityFactor = 7587000 * _bulletMass / (_twist^2 * _caliber^3 * _length * (1 + _length^2)); if (_muzzleVelocity > 341.376) then { (_stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3)) * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure diff --git a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf index 6bc6e234ae..6a9c7ce243 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -15,17 +15,16 @@ private _aceTimeSecond = floor CBA_missionTime; { - private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"]; - _x params["_bullet","_caliber","_bulletTraceVisible","_index"]; + _x params ["_bullet","_caliber","_bulletTraceVisible","_index"]; - _bulletVelocity = velocity _bullet; + private _bulletVelocity = velocity _bullet; - _bulletSpeed = vectorMagnitude _bulletVelocity; + private _bulletSpeed = vectorMagnitude _bulletVelocity; if (!alive _bullet || _bulletSpeed < 100) then { GVAR(allBullets) deleteAt (GVAR(allBullets) find _x); } else { - _bulletPosition = getPosASL _bullet; + private _bulletPosition = getPosASL _bullet; if (_bulletTraceVisible && _bulletSpeed > 500) then { drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf index ec6f3a6212..7c97e10bda 100644 --- a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -15,11 +15,10 @@ */ #include "script_component.hpp" -private ["_weaponConfig", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"]; -_weaponConfig = (configFile >> "CfgWeapons" >> _this); +private _weaponConfig = (configFile >> "CfgWeapons" >> _this); -_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist"); -_twistDirection = 1; +private _barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist"); +private _twistDirection = 1; if (isNumber (_weaponConfig >> "ACE_twistDirection")) then { _twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection"); if !(_twistDirection in [-1, 0, 1]) then { @@ -27,9 +26,9 @@ if (isNumber (_weaponConfig >> "ACE_twistDirection")) then { }; }; -_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength"); +private _barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength"); -_result = [_barrelTwist, _twistDirection, _barrelLength]; +private _result = [_barrelTwist, _twistDirection, _barrelLength]; uiNamespace setVariable [format[QGVAR(%1), _weapon], _result]; diff --git a/addons/atragmx/functions/fnc_add_new_gun.sqf b/addons/atragmx/functions/fnc_add_new_gun.sqf index 5c67c26481..dbc85cc27f 100644 --- a/addons/atragmx/functions/fnc_add_new_gun.sqf +++ b/addons/atragmx/functions/fnc_add_new_gun.sqf @@ -15,11 +15,9 @@ */ #include "script_component.hpp" -private ["_gunName", "_gunProfileEntry"]; - -_gunName = ctrlText 11001; +private _gunName = ctrlText 11001; if (_gunName != "") then { - _gunProfileEntry = [_gunName, 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.393, 1, "ICAO"], + private _gunProfileEntry = [_gunName, 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.393, 1, "ICAO"], GVAR(gunList) = GVAR(gunList) + [_gunProfileEntry]; diff --git a/addons/atragmx/functions/fnc_calculate_range_card.sqf b/addons/atragmx/functions/fnc_calculate_range_card.sqf index 20c9004f16..0b6d0a177b 100644 --- a/addons/atragmx/functions/fnc_calculate_range_card.sqf +++ b/addons/atragmx/functions/fnc_calculate_range_card.sqf @@ -17,21 +17,20 @@ [] call FUNC(parse_input); -private ["_scopeBaseAngle"]; -_scopeBaseAngle = (GVAR(workingMemory) select 3); +GVAR(workingMemory) params ["", + "_muzzleVelocity", "", + "_scopeBaseAngle", + "_airFriction", + "_boreHeight", "", "", "", "", "", "", + "_bulletMass", + "_bulletDiameter", + "_barrelTwist", + "_bc", + "_dragModel", + "_atmosphereModel" +]; -private ["_bulletMass", "_bulletDiameter", "_boreHeight", "_airFriction", "_barrelTwist", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel", "_twistDirection"]; -_bulletMass = GVAR(workingMemory) select 12; -_bulletDiameter = GVAR(workingMemory) select 13; -_boreHeight = GVAR(workingMemory) select 5; -_airFriction = GVAR(workingMemory) select 4; -_barrelTwist = GVAR(workingMemory) select 14; -_muzzleVelocity = GVAR(workingMemory) select 1; -_bc = GVAR(workingMemory) select 15; -_dragModel = GVAR(workingMemory) select 16; -_atmosphereModel = GVAR(workingMemory) select 17; - -_twistDirection = 0; +private _twistDirection = 0; if (_barrelTwist > 0) then { _twistDirection = 1; } else { @@ -39,42 +38,38 @@ if (_barrelTwist > 0) then { _twistDirection = -1; }; }; -_barrelTwist = abs(_barrelTwist); +_barrelTwist = abs _barrelTwist; -private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; -_altitude = GVAR(altitude); -_temperature = GVAR(temperature); -_barometricPressure = GVAR(barometricPressure); -_relativeHumidity = GVAR(relativeHumidity); +private _altitude = GVAR(altitude); +private _temperature = GVAR(temperature); +private _barometricPressure = GVAR(barometricPressure); +private _relativeHumidity = GVAR(relativeHumidity); if (!GVAR(atmosphereModeTBH)) then { _barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495; _relativeHumidity = 50; }; -private ["_bulletLength", "_stabilityFactor"]; -_bulletLength = 45.72; -_stabilityFactor = 1.5; +private _bulletLength = 45.72; +private _stabilityFactor = 1.5; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { _stabilityFactor = [_bulletDiameter, _bulletLength, _bulletMass, _barrelTwist * 10, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); }; }; -private ["_latitude", "_directionOfFire", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; -_latitude = GVAR(latitude) select GVAR(currentTarget); -_directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); -_windSpeed1 = (GVAR(windSpeed1) select GVAR(currentTarget)); -_windSpeed2 = (GVAR(windSpeed2) select GVAR(currentTarget)); -_windDirection = (GVAR(windDirection) select GVAR(currentTarget)); -_inclinationAngle = (GVAR(inclinationAngle) select GVAR(currentTarget)); -_targetSpeed = (GVAR(targetSpeed) select GVAR(currentTarget)); -_targetRange = GVAR(rangeCardEndRange); +private _latitude = GVAR(latitude) select GVAR(currentTarget); +private _directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); +private _windSpeed1 = (GVAR(windSpeed1) select GVAR(currentTarget)); +private _windSpeed2 = (GVAR(windSpeed2) select GVAR(currentTarget)); +private _windDirection = (GVAR(windDirection) select GVAR(currentTarget)); +private _inclinationAngle = (GVAR(inclinationAngle) select GVAR(currentTarget)); +private _targetSpeed = (GVAR(targetSpeed) select GVAR(currentTarget)); +private _targetRange = GVAR(rangeCardEndRange); if (GVAR(currentUnit) == 1) then { _targetRange = _targetRange / 1.0936133; }; GVAR(rangeCardData) = []; -private ["_result"]; -_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, +private _result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true, _stabilityFactor, _twistDirection, _latitude, _directionOfFire] call FUNC(calculate_solution); diff --git a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf index 5a217a07d2..e59cdee37d 100644 --- a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf @@ -15,10 +15,8 @@ */ #include "script_component.hpp" -private ["_targetSize", "_imageSize", "_angle", "_estRange"]; - -_angle = parseNumber(ctrlText 7012); -_targetSize = parseNumber(ctrlText 7010); +private _angle = parseNumber(ctrlText 7012); +private _targetSize = parseNumber(ctrlText 7010); if (GVAR(rangeAssistUseTargetHeight)) then { _targetSize = _targetSize * cos(_angle); }; @@ -33,7 +31,7 @@ switch (GVAR(rangeAssistTargetSizeUnit)) do { _targetSize = _targetSize * 0.01; }; }; -_imageSize = parseNumber(ctrlText 7011); +private _imageSize = parseNumber(ctrlText 7011); switch (GVAR(rangeAssistImageSizeUnit)) do { case 0: { _imageSize = _imageSize / 6400 * 360; @@ -45,7 +43,7 @@ switch (GVAR(rangeAssistImageSizeUnit)) do { _imageSize = _imageSize / 60 / 1.047; }; }; -_estRange = parseNumber(ctrlText 7013); +private _estRange = parseNumber(ctrlText 7013); if (GVAR(currentUnit) == 1) then { _estRange = _estRange / 1.0936133; }; diff --git a/addons/atragmx/functions/fnc_change_target_slot.sqf b/addons/atragmx/functions/fnc_change_target_slot.sqf index ed8c622b8d..a867749f21 100644 --- a/addons/atragmx/functions/fnc_change_target_slot.sqf +++ b/addons/atragmx/functions/fnc_change_target_slot.sqf @@ -15,8 +15,7 @@ */ #include "script_component.hpp" -private ["_target"]; -_target = 0 max _this min 3; +private _target = 0 max _this min 3; call FUNC(parse_input); diff --git a/addons/atragmx/functions/fnc_delete_gun.sqf b/addons/atragmx/functions/fnc_delete_gun.sqf index 62a95d8ece..42970d7aab 100644 --- a/addons/atragmx/functions/fnc_delete_gun.sqf +++ b/addons/atragmx/functions/fnc_delete_gun.sqf @@ -15,8 +15,7 @@ */ #include "script_component.hpp" -private ["_index"]; -_index = lbCurSel 6000; +private _index = lbCurSel 6000; if (_index == -1) exitWith {}; diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index 692de386af..d270dbf4c3 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -23,9 +23,8 @@ if !(ctrlVisible 9000) then { ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 9002); [{ - private ["_args", "_startTime"]; - _args = _this select 0; - _startTime = _args select 0; + params ["_args"]; + _args params ["_startTime"]; if (!(GVAR(speedAssistTimer))) exitWith { GVAR(speedAssistTimer) = true; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index cf80e74b1c..366a43d900 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -68,7 +68,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _model; [{ - private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"]; + private ["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"]; params ["_args","_idPFH"]; _args params ["_unit","_attachToVehicle","_itemClassname","_itemVehClass","_onAtachText","_actionID"]; diff --git a/addons/attach/functions/fnc_handleGetIn.sqf b/addons/attach/functions/fnc_handleGetIn.sqf index dd173c4125..0d39a00718 100644 --- a/addons/attach/functions/fnc_handleGetIn.sqf +++ b/addons/attach/functions/fnc_handleGetIn.sqf @@ -22,10 +22,8 @@ TRACE_1("params",_unit); if (!local _unit) exitWith {}; -private ["_attachedList"]; - -_attachedList = _unit getVariable [QGVAR(attached), []]; -if ((count _attachedList) == 0) exitWith {}; +private _attachedList = _unit getVariable [QGVAR(attached), []]; +if (_attachedList isEqualTo []) exitWith {}; (_attachedList select 0) params ["_xObject"]; if (!isNull _xObject) then { diff --git a/addons/attach/functions/fnc_handleGetOut.sqf b/addons/attach/functions/fnc_handleGetOut.sqf index 4ed268d5dc..8eaebd6b21 100644 --- a/addons/attach/functions/fnc_handleGetOut.sqf +++ b/addons/attach/functions/fnc_handleGetOut.sqf @@ -22,10 +22,8 @@ TRACE_1("params",_unit); if (!local _unit) exitWith {}; -private ["_attachedList"]; - -_attachedList = _unit getVariable [QGVAR(attached), []]; -if ((count _attachedList) == 0) exitWith {}; +private _attachedList = _unit getVariable [QGVAR(attached), []]; +if (_attachedList isEqualTo []) exitWith {}; (_attachedList select 0) params ["_xObject", "_xItemName"]; if (isNull _xObject) then { diff --git a/addons/attach/functions/fnc_handleKilled.sqf b/addons/attach/functions/fnc_handleKilled.sqf index 69ab31122b..81c2d659d4 100644 --- a/addons/attach/functions/fnc_handleKilled.sqf +++ b/addons/attach/functions/fnc_handleKilled.sqf @@ -19,11 +19,9 @@ params ["_deadUnit"]; TRACE_1("params",_deadUnit); -private ["_attachedList"]; +private _attachedList = _deadUnit getVariable [QGVAR(attached), []]; -_attachedList = _deadUnit getVariable [QGVAR(attached), []]; - -if ((count _attachedList) == 0) exitWith {}; +if (_attachedList isEqualTo []) exitWith {}; { _x params ["_xObject"]; diff --git a/addons/ballistics/scripts/initTargetWall.sqf b/addons/ballistics/scripts/initTargetWall.sqf index 0ce3950de1..7f9578f09a 100644 --- a/addons/ballistics/scripts/initTargetWall.sqf +++ b/addons/ballistics/scripts/initTargetWall.sqf @@ -1,12 +1,10 @@ // by commy2 #include "script_component.hpp" -private "_paper"; - params ["_wall"]; if (local _wall) then { - _paper = "UserTexture_1x2_F" createVehicle position _wall; + private _paper = "UserTexture_1x2_F" createVehicle position _wall; _paper attachTo [_wall, [0,-0.02,0.6]]; _paper setDir getDir _wall; diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index c5a8a38ed3..25f41d1320 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -13,8 +13,7 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", { params ["_disconnectedPlayer"]; - private "_escortedUnit"; - _escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull]; + private _escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull]; if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then { detach _escortedUnit; }; diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf index de0a88d871..2b58b54d2d 100644 --- a/addons/captives/functions/fnc_canSurrender.sqf +++ b/addons/captives/functions/fnc_canSurrender.sqf @@ -16,11 +16,9 @@ */ #include "script_component.hpp" -private "_returnValue"; - params ["_unit", "_newSurrenderState"]; -_returnValue = if (_newSurrenderState) then { +private _returnValue = if (_newSurrenderState) then { //no weapon equiped AND not currently surrendering and GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])} } else { diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index 6bd98cf4eb..82fc0a8429 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -16,8 +16,6 @@ */ #include "script_component.hpp" -private ["_cargo"]; - params ["_player", "_unit"]; ((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]} diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index 9a8a423dc3..d3ddecfd13 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -16,20 +16,18 @@ */ #include "script_component.hpp" -private ["_weapon", "_listedItemClasses", "_actions", "_allGear"]; - params ["_player", "_unit"]; -_weapon = currentWeapon _player; +private _weapon = currentWeapon _player; if (_weapon == primaryWeapon _player && {_weapon != ""}) then { [_player, "AmovPercMstpSlowWrflDnon", 0] call EFUNC(common,doAnimation); }; -_listedItemClasses = []; +private _listedItemClasses = []; -_actions = [localize LSTRING(FriskMenuHeader), ""] call ACE_Interaction_fnc_prepareSelectMenu; +private _actions = [localize LSTRING(FriskMenuHeader), ""] call ACE_Interaction_fnc_prepareSelectMenu; -_allGear = []; +private _allGear = []; if ((handgunWeapon _unit) != "") then { _allGear pushBack (handgunWeapon _unit); @@ -54,8 +52,7 @@ if (count (assignedItems _unit) > 0) then { // Assigned Items { if (!(_x in _listedItemClasses)) then { - private "_item"; - _item = configFile >> "CfgMagazines" >> _x; + private _item = configFile >> "CfgMagazines" >> _x; if (isNil "_item" || str _item == "") then { //str _item ? _item = configFile >> "CfgWeapons" >> _x; }; diff --git a/addons/captives/functions/fnc_handleGetOut.sqf b/addons/captives/functions/fnc_handleGetOut.sqf index dea97eb600..7ec510dbf1 100644 --- a/addons/captives/functions/fnc_handleGetOut.sqf +++ b/addons/captives/functions/fnc_handleGetOut.sqf @@ -21,9 +21,7 @@ params ["_vehicle", "", "_unit"]; TRACE_2("params",_vehicle,_unit); if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { - private ["_cargoIndex"]; - - _cargoIndex = _unit getVariable [QGVAR(CargoIndex), -1]; + private _cargoIndex = _unit getVariable [QGVAR(CargoIndex), -1]; if (_cargoIndex != -1) then { //If captive was not "unloaded", then move them back into the vehicle. diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index bdd4915d68..b95438fa22 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -23,8 +23,7 @@ if (!local _unit) exitWith {}; // Group and side respawn can potentially respawn you as a captive unit // Base and instant respawn cannot, so captive should be entirely reset // So we explicity account for the respawn type -private ["_respawn"]; -_respawn = [0] call BIS_fnc_missionRespawnType; +private _respawn = [0] call BIS_fnc_missionRespawnType; if (_respawn > 3) then { if (_unit getVariable [QGVAR(isHandcuffed), false]) then { diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf index 0839c61ea1..dbd3e0af5c 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf @@ -19,11 +19,9 @@ params ["_target","_vehicle"]; TRACE_2("params",_target,_vehicle); -private ["_cargoIndex"]; - _getSeat = [_vehicle] call FUNC(findEmptyNonFFVCargoSeat); TRACE_1("free cargo seat",_getSeat); -_cargoIndex = _getSeat select 0; +_getSeat params ["_cargoIndex"]; if (_cargoIndex == -1) exitWith {ERROR("cargo index -1");}; _target moveInCargo [_vehicle, _cargoIndex]; diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index 3b5571f260..c65a9bddbc 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -25,9 +25,8 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex if (isServer) then { { if (isClass _x) then { - private ["_cargoClassname", "_cargoCount"]; - _cargoClassname = getText (_x >> "type"); - _cargoCount = getNumber (_x >> "amount"); + private _cargoClassname = getText (_x >> "type"); + private _cargoCount = getNumber (_x >> "amount"); TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount); ["ace_addCargo", [_cargoClassname, _vehicle, _cargoCount]] call CBA_fnc_localEvent; }; diff --git a/addons/common/functions/fnc_actionKeysNamesConverted.sqf b/addons/common/functions/fnc_actionKeysNamesConverted.sqf index d60df89bfb..fae1fb939e 100644 --- a/addons/common/functions/fnc_actionKeysNamesConverted.sqf +++ b/addons/common/functions/fnc_actionKeysNamesConverted.sqf @@ -91,7 +91,7 @@ private _keybinds = actionKeysNamesArray _action apply { _alt = true; }; default { - // @todo handle double keys? ("C+R") + // @todo handle double keys? ("C + R") // currently only reports last key // not usable by keyDown by default _key = _keyTable find _x; diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index e4f824791a..ff8598d056 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -69,9 +69,9 @@ private _refresh = { private _position = switch (_setting) do { case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_forEachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; + case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_forEachIndex + 3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_forEachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_forEachIndex + 3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; default {[X_POS_ICONS, Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; }; diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf index 9ab15bacd5..5d6e5d71b5 100644 --- a/addons/common/functions/fnc_getInPosition.sqf +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -171,8 +171,7 @@ switch (_position) do { }; case "cargo" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + private _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); { if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 517e0aa2ad..2939edad18 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -53,8 +53,7 @@ _unit action ["Eject", vehicle _unit]; [_unit, _anim, 1, true] call FUNC(doAnimation); [{ - _unit = _this select 0; - _anim = _this select 1; + params ["_unit", "_anim"]; if ((_unit getVariable "ACE_isUnconscious") and (animationState _unit != _anim)) then { [_unit, _anim, 2, true] call FUNC(doAnimation); }; diff --git a/addons/common/scripts/checkVersionNumber.sqf b/addons/common/scripts/checkVersionNumber.sqf index 402e5d9f56..6267ed08b2 100644 --- a/addons/common/scripts/checkVersionNumber.sqf +++ b/addons/common/scripts/checkVersionNumber.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -private["_client", "_clientVersion", "_count", "_error", "_files", "_index", "_missingAddon", "_missingAddonServer", "_missingAddons", "_missingAddonsServer", "_oldVersionClient", "_oldVersionServer", "_oldVersionsClient", "_oldVersionsServer", "_serverFiles", "_serverVersion", "_serverVersions", "_string", "_version", "_versions"]; +private ["_client", "_clientVersion", "_count", "_error", "_files", "_index", "_missingAddon", "_missingAddonServer", "_missingAddons", "_missingAddonsServer", "_oldVersionClient", "_oldVersionServer", "_oldVersionsClient", "_oldVersionsServer", "_serverFiles", "_serverVersion", "_serverVersions", "_string", "_version", "_versions"]; _files = []; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index aedc8b9608..67b3584de2 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -16,17 +16,15 @@ PARAMS_2(_wirecoil,_unit); -private ["_wireNoGeo", "_dir", "_pos", "_wireNoGeoPos"]; - -_wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; +private _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; { _wireNoGeo animate [_x, 1]; } count WIRE_FAST; GVAR(placer) = _unit; -_dir = getDir _unit; -_pos = getPosASL _unit; -_wireNoGeoPos = _pos vectorAdd [1.1 * sin(_dir), 1.1 * cos(_dir), 0]; +private _dir = getDir _unit; +private _pos = getPosASL _unit; +private _wireNoGeoPos = _pos vectorAdd [1.1 * sin(_dir), 1.1 * cos(_dir), 0]; _wireNoGeo setDir _dir; _wireNoGeo setPosASL _wireNoGeoPos; @@ -39,16 +37,15 @@ GVAR(deployPFH) = [{ params ["_args", "_idPFH"]; _args params ["_wireNoGeo", "_wireNoGeoPos", "_unit"]; - private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"]; - _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); - _posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit); - _dirVect = _posStart vectorDiff _posEnd; - _dir = _dirVect call CBA_fnc_vectDir; - _range = vectorMagnitude _dirVect; - _anim = 0 max (1 - (_range / 12)); + private _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); + private _posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit); + private _dirVect = _posStart vectorDiff _posEnd; + private _dir = _dirVect call CBA_fnc_vectDir; + private _range = vectorMagnitude _dirVect; + private _anim = 0 max (1 - (_range / 12)); if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith { - _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; + private _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; { _wire animate [_x, _anim]; } count WIRE_FAST; diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf index 50429c054b..9dcd50cc4a 100644 --- a/addons/concertina_wire/functions/fnc_dismount.sqf +++ b/addons/concertina_wire/functions/fnc_dismount.sqf @@ -22,12 +22,10 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit }; params ["_wire", "_unit"]; -private ["_config", "_delay"]; -_config = (configFile >> "CfgVehicles" >> typeOf _unit); -_delay = if (getNumber(_config >> "engineer") == 1 || getNumber(_config >> "canDeactivateMines") == 1) then {60} else {120}; +private _config = (configFile >> "CfgVehicles" >> typeOf _unit); +private _delay = [120, 60] select (getNumber (_config >> "engineer") == 1 || {getNumber (_config >> "canDeactivateMines") == 1}); // TODO: Animation? - [ _delay, [_wire], diff --git a/addons/concertina_wire/functions/fnc_handleKilled.sqf b/addons/concertina_wire/functions/fnc_handleKilled.sqf index c654dd0f50..7fb5ef6e1b 100644 --- a/addons/concertina_wire/functions/fnc_handleKilled.sqf +++ b/addons/concertina_wire/functions/fnc_handleKilled.sqf @@ -16,8 +16,6 @@ params ["_wire", "_killer"]; TRACE_2("params",_wire,_killer); -private ["_distance", "_vehicle"]; - if (isNull _killer) then { _killer = _wire getVariable [QGVAR(lastDamager), objNull]; if (isNull _killer) then { @@ -29,9 +27,9 @@ if (isNull _killer) then { }; if (isNull _killer || {_killer == _wire} || {_killer == gunner (vehicle _killer)}) exitWith {}; -_distance = _wire distance _killer; +private _distance = _wire distance _killer; if (_distance > 14 || {_distance < 2}) exitWith {}; // Fix if shooting wire -_vehicle = vehicle _killer; +private _vehicle = vehicle _killer; [QGVAR(vehicleDamage), [_wire, _vehicle], [_vehicle]] call CBA_fnc_targetEvent; diff --git a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf index 0bca28c3cf..e5732f7000 100644 --- a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf @@ -45,10 +45,10 @@ if (_mode == 0) then { // Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle) _wireCheckPosAr = [ - [_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)], - [(_x-(sin _dir_w)) + (sin (_dir_w+90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w+90) * 1.5)], - [_x + (sin (_dir_w-90) * 1.5),_y + (cos (_dir_w-90) * 1.5)], - [(_x-(sin _dir_w)) + (sin (_dir_w-90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w-90) * 1.5)] + [_x + (sin (_dir_w + 90) * 1.5),_y + (cos (_dir_w + 90) * 1.5)], + [(_x-(sin _dir_w)) + (sin (_dir_w + 90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w + 90) * 1.5)], + [_x + (sin (_dir_w - 90) * 1.5),_y + (cos (_dir_w - 90) * 1.5)], + [(_x-(sin _dir_w)) + (sin (_dir_w - 90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w - 90) * 1.5)] ]; { _found = false; @@ -113,7 +113,7 @@ if (_mode == 1) then { _vPos = getPosASL _vehicle; _vDir = getDir _vehicle; _vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]); - // TODO: Needs to be placed in safe distance to wire, so we do not constantly re-spawn new wires + // TODO: Needs to be placed in safe distance to wire, so we do not constantly re - spawn new wires }, [_vehicle, _wire], 0.1] call CBA_fnc_waitAndExecute; }; diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index 9bf36c393c..c4aa989854 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -447,11 +447,10 @@ GVAR(menuRun) = true; }; }; if (GVAR(F2)) then { - private ["_grid", "_gridVector"]; - _grid = toArray GVAR(vectorGrid); + private _grid = toArray GVAR(vectorGrid); _grid deleteAt 4; _grid = toString _grid; - _gridVector = parseNumber _grid; + private _gridVector = parseNumber _grid; GVAR(digit1) = floor(_gridVector / 10000000); GVAR(digit2) = floor(_gridVector / 1000000 - GVAR(digit1) *10); GVAR(digit3) = floor(_gridVector / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100); diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index a981514e54..0fcc3ccbda 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -30,7 +30,7 @@ __background ctrlSetText QPATHTOF(UI\dagr_gps.paa); if (GVAR(outputPFH) != -1) exitWith {}; GVAR(outputPFH) = [{ - private["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"]; + private ["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"]; // Abort Condition if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index 2d1aee4d4e..d36f222a51 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -30,7 +30,7 @@ __background ctrlSetText QPATHTOF(UI\dagr_wp.paa); if (GVAR(outputPFH) != -1) exitWith {}; GVAR(outputPFH) = [{ - private["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"]; + private ["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"]; // Abort Condition if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { diff --git a/addons/disarming/functions/fnc_eventTargetStart.sqf b/addons/disarming/functions/fnc_eventTargetStart.sqf index 29c370f2b5..77dfd9d271 100644 --- a/addons/disarming/functions/fnc_eventTargetStart.sqf +++ b/addons/disarming/functions/fnc_eventTargetStart.sqf @@ -21,9 +21,7 @@ params ["_caller", "_target", "_listOfObjectsToRemove"]; -private "_itemsToAdd"; - -_itemsToAdd = []; +private _itemsToAdd = []; { if (_x == (uniform _target)) then { _itemsToAdd = _itemsToAdd + (uniformItems _target); diff --git a/addons/disarming/functions/fnc_getAllGearContainer.sqf b/addons/disarming/functions/fnc_getAllGearContainer.sqf index 0394761197..105be91a9e 100644 --- a/addons/disarming/functions/fnc_getAllGearContainer.sqf +++ b/addons/disarming/functions/fnc_getAllGearContainer.sqf @@ -18,10 +18,8 @@ params ["_target"]; -private ["_items", "_counts"]; - -_items = []; -_counts = []; +private _items = []; +private _counts = []; { _x params ["_item", "_count"]; _items append _item; diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index 0883fde2dd..6763f9a9fa 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -17,7 +17,6 @@ */ #include "script_component.hpp" params ["_caller", "_target"]; -private "_display"; #define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa" //Sanity Checks if (_caller != ACE_player) exitWith {ERROR("Player isn't caller?");}; @@ -28,7 +27,7 @@ disableSerialization; createDialog QGVAR(remoteInventory); -_display = uiNamespace getVariable ["ACE_remoteInventory", displayNull]; +private _display = uiNamespace getVariable ["ACE_remoteInventory", displayNull]; if (isNull _display) exitWith {ERROR("Display is Null");}; GVAR(disarmTarget) = _target; diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index f675012ee3..82b9645850 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -18,20 +18,17 @@ #include "script_component.hpp" disableSerialization; -private ["_classname", "_count", "_displayName", "_picture"]; params ["_listBoxCtrl", "_itemsCountArray"]; { - private "_configPath"; - _displayName = ""; - _picture = ""; - - _classname = _x; - _count = (_itemsCountArray select 1) select _forEachIndex; + private _classname = _x; + private _count = (_itemsCountArray select 1) select _forEachIndex; if ((_classname != DUMMY_ITEM) && {_classname != "ACE_FakePrimaryWeapon"}) then { //Don't show the dummy potato or fake weapon - + private "_configPath"; + private _displayName = ""; + private _picture = ""; switch (true) do { case (isClass (configFile >> "CfgWeapons" >> _classname)): { _configPath = (configFile >> "CfgWeapons"); diff --git a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf index efe5aae72a..c324ab5268 100644 --- a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf +++ b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf @@ -21,8 +21,6 @@ */ #include "script_component.hpp" -private ["_problem", "_beginingArray", "_index"]; - PARAMS_4(_startA,_endA,_startB,_endB); //Quick Lazy Count Check @@ -30,11 +28,11 @@ if (((count _startA) + (count _startB)) != ((count _endA) + (count _endB))) exit false }; -_beginingArray = (_startA + _startB); +private _beginingArray = (_startA + _startB); -_problem = false; +private _problem = false; { - _index = _beginingArray find _x; + private _index = _beginingArray find _x; if (_index == -1) exitWith {_problem = true;}; _beginingArray deleteAt _index; } forEach (_endA + _endB); diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index 24d254ac04..df198fafb3 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -21,7 +21,7 @@ params ["_unit", "_explosive", "_magazineClass", "_extra"]; TRACE_4("params",_unit,_explosive,_magazineClass,_extra); -private["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"]; +private ["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"]; // Config is the last item in the list of passed in items. _config = (_this select 3) select (count (_this select 3) - 1); diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index fc494a5fad..0ee3ca9f78 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -36,9 +36,11 @@ _itemCount = []; _children = []; { - private "_name"; - _name = if(isText(_x >> "displayNameShort") && {getText(_x >> "displayNameShort") != ""}) then - {getText (_x >> "displayNameShort")}else{getText(_x >> "displayName")}; + private _name = getText (_x >> "displayNameShort"); + if (_name isEqualTo "") then { + _name = getText (_x >> "displayName"); + }; + _children pushBack [ [ diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index 6bfeac8595..e205f9b381 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -27,7 +27,7 @@ _unit setVariable [QGVAR(Dialing), true, true]; _ran = (ceil(random 8)) + 1; _arr = []; -for [{_i=0}, {_i<_ran}, {_i=_i+1}] do { +for [{_i=0}, {_i<_ran}, {_i=_i + 1}] do { _arr = _arr + ['.','..','...','']; }; if (_unit == ace_player) then { diff --git a/addons/explosives/functions/fnc_dialingPhone.sqf b/addons/explosives/functions/fnc_dialingPhone.sqf index bc57ddd4b2..aa20ebf4b0 100644 --- a/addons/explosives/functions/fnc_dialingPhone.sqf +++ b/addons/explosives/functions/fnc_dialingPhone.sqf @@ -26,8 +26,7 @@ if ((_i mod 4) == 0) then { }; ctrlSetText [1400,format["Calling%1",_arr select (_i - 4)]]; -private "_explosive"; -_explosive = [_code] call FUNC(getSpeedDialExplosive); +private _explosive = [_code] call FUNC(getSpeedDialExplosive); if (_i >= (count _arr + 2)) then { [_pfID] call CALLSTACK(CBA_fnc_removePerFrameHandler); diff --git a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf index 00b1cbba2a..d15b1b34c7 100644 --- a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf +++ b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf @@ -15,9 +15,7 @@ */ #include "script_component.hpp" -private "_speedDial"; - -_speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; +private _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; if (count _speedDial == 0) exitWith {}; { if ((_x select 0) == (_this select 0)) exitWith { diff --git a/addons/explosives/functions/fnc_selectTrigger.sqf b/addons/explosives/functions/fnc_selectTrigger.sqf index 203bfaf606..77018ea587 100644 --- a/addons/explosives/functions/fnc_selectTrigger.sqf +++ b/addons/explosives/functions/fnc_selectTrigger.sqf @@ -20,9 +20,7 @@ params ["_explosive", "_magazine", "_trigger"]; TRACE_3("params",_explosive,_magazine,_trigger); -private ["_config"]; - -_config = ConfigFile >> "ACE_Triggers" >> _trigger; +private _config = ConfigFile >> "ACE_Triggers" >> _trigger; // If the onSetup function returns true, it is handled elsewhere if (isText(_config >> "onSetup") && {[_explosive,_magazine] call compile getText (_config >> "onSetup")}) exitWith { diff --git a/addons/explosives/functions/fnc_setSpeedDial.sqf b/addons/explosives/functions/fnc_setSpeedDial.sqf index 7e68c9016f..1876a50103 100644 --- a/addons/explosives/functions/fnc_setSpeedDial.sqf +++ b/addons/explosives/functions/fnc_setSpeedDial.sqf @@ -15,13 +15,12 @@ * Public: No */ #include "script_component.hpp" -private ["_speedDial", "_amount"]; -_speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; -if (count _speedDial == 0) exitWith {}; -_amount = if((_this select 0))then{1}else{-1}; +private _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; +if (_speedDial isEqualTo []) exitWith {}; +private _amount = [-1, 1] select (_this select 0); GVAR(CurrentSpeedDial) = (GVAR(CurrentSpeedDial) + _amount + count _speedDial) mod (count _speedDial); -ctrlSetText [1400,(_speedDial select GVAR(CurrentSpeedDial)) select 1]; -ctrlSetText [1401,(_speedDial select GVAR(CurrentSpeedDial)) select 0]; +ctrlSetText [1400, (_speedDial select GVAR(CurrentSpeedDial)) select 1]; +ctrlSetText [1401, (_speedDial select GVAR(CurrentSpeedDial)) select 0]; diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 0897836eb3..47608d03e5 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -24,7 +24,7 @@ params ["_vehicle", "_unit", "_magClassname"]; TRACE_3("params",_vehicle,_unit,_magClassname); -private["_isAttachable", "_setupObjectClass", "_supportedTriggers", "_p3dModel"]; +private ["_isAttachable", "_setupObjectClass", "_supportedTriggers", "_p3dModel"]; //Get setup object vehicle and model: _setupObjectClass = getText(ConfigFile >> "CfgMagazines" >> _magClassname >> QGVAR(SetupObject)); @@ -62,7 +62,7 @@ GVAR(TweakedAngle) = 0; params ["_args", "_pfID"]; _args params ["_unit", "_magClassname", "_setupObjectClass", "_isAttachable"]; - private["_angle", "_attachVehicle", "_badPosition", "_basePosASL", "_cameraAngle", "_distanceFromBase", "_expSetupVehicle", "_index", "_intersectsWith", "_lookDirVector", "_max", "_min", "_modelDir", "_modelOffset", "_modelUp", "_placeAngle", "_realDistance", "_return", "_screenPos", "_testBase", "_testPos", "_testPositionIsValid", "_virtualPosASL"]; + private ["_angle", "_attachVehicle", "_badPosition", "_basePosASL", "_cameraAngle", "_distanceFromBase", "_expSetupVehicle", "_index", "_intersectsWith", "_lookDirVector", "_max", "_min", "_modelDir", "_modelOffset", "_modelUp", "_placeAngle", "_realDistance", "_return", "_screenPos", "_testBase", "_testPos", "_testPositionIsValid", "_virtualPosASL"]; _lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,0,10]) call EFUNC(common,positionToASL)); _basePosASL = (eyePos _unit); diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index 99d68a5734..95e258696c 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -19,7 +19,7 @@ params ["_unit", "_target"]; TRACE_2("params",_unit,_target); -private["_actionToPlay", "_defuseTime", "_isEOD"]; +private ["_actionToPlay", "_defuseTime", "_isEOD"]; _target = attachedTo (_target); diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index 0fc29e34ad..7f763dbdea 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -18,7 +18,7 @@ params ["_magazineClassname"]; TRACE_1("params",_magazineClassname); -private["_result", "_config", "_count", "_index"]; +private ["_result", "_config", "_count", "_index"]; _result = []; _config = getArray (ConfigFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); diff --git a/addons/fastroping/functions/fnc_deployRopes.sqf b/addons/fastroping/functions/fnc_deployRopes.sqf index c944b2c3cb..6e61ed232d 100644 --- a/addons/fastroping/functions/fnc_deployRopes.sqf +++ b/addons/fastroping/functions/fnc_deployRopes.sqf @@ -16,31 +16,30 @@ #include "script_component.hpp" params ["_vehicle"]; -private ["_config", "_ropeOrigins", "_ropeOrigin", "_deployedRopes", "_hookAttachment", "_origin", "_dummy", "_hook", "_ropeTop", "_ropeBottom"]; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_ropeOrigins = getArray (_config >> QGVAR(ropeOrigins)); -_deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; -_hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle]; +private _ropeOrigins = getArray (_config >> QGVAR(ropeOrigins)); +private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; +private _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle]; { - _ropeOrigin = _x; - _hook = QGVAR(helper) createVehicle [0, 0, 0]; + private _ropeOrigin = _x; + private _hook = QGVAR(helper) createVehicle [0, 0, 0]; _hook allowDamage false; - if (typeName _ropeOrigin == "ARRAY") then { + if (_ropeOrigin isEqualType []) then { _hook attachTo [_hookAttachment, _ropeOrigin]; } else { _hook attachTo [_hookAttachment, [0, 0, 0], _ropeOrigin]; }; - _origin = getPosATL _hook; + private _origin = getPosATL _hook; - _dummy = createVehicle [QGVAR(helper), _origin vectorAdd [0, 0, -1], [], 0, "CAN_COLLIDE"]; + private _dummy = createVehicle [QGVAR(helper), _origin vectorAdd [0, 0, -1], [], 0, "CAN_COLLIDE"]; _dummy allowDamage false; _dummy disableCollisionWith _vehicle; - _ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5]; - _ropeBottom = ropeCreate [_dummy, [0, 0, 0], 1]; + private _ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5]; + private _ropeBottom = ropeCreate [_dummy, [0, 0, 0], 1]; ropeUnwind [_ropeBottom, 30, 34.5, false]; _ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}]; diff --git a/addons/finger/functions/fnc_incomingFinger.sqf b/addons/finger/functions/fnc_incomingFinger.sqf index df9fbefe8f..5a970aa372 100644 --- a/addons/finger/functions/fnc_incomingFinger.sqf +++ b/addons/finger/functions/fnc_incomingFinger.sqf @@ -22,7 +22,7 @@ params ["_sourceUnit", "_fingerPosPrecise", "_distance"]; private _fingerPos = if (_sourceUnit == ACE_player) then { _fingerPosPrecise } else { - _fingerPosPrecise vectorAdd ([random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y] vectorMultiply _distance) + _fingerPosPrecise vectorAdd ([random (2 * FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2 * FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2 * FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y] vectorMultiply _distance) }; TRACE_3("incoming finger:", _sourceUnit, _fingerPosPrecise, _fingerPos); diff --git a/addons/frag/functions/fnc_addBlackList.sqf b/addons/frag/functions/fnc_addBlackList.sqf index 53c163b04c..1a7d7cb253 100644 --- a/addons/frag/functions/fnc_addBlackList.sqf +++ b/addons/frag/functions/fnc_addBlackList.sqf @@ -1,4 +1,3 @@ #include "script_component.hpp" -private ["_round"]; -_round = _this select 0; +params ["_round"]; GVAR(blackList) set [(count GVAR(blackList)), _round]; diff --git a/addons/frag/functions/fnc_addPfhRound.sqf b/addons/frag/functions/fnc_addPfhRound.sqf index eb61500843..f0047bb24d 100644 --- a/addons/frag/functions/fnc_addPfhRound.sqf +++ b/addons/frag/functions/fnc_addPfhRound.sqf @@ -55,7 +55,7 @@ if(_doFragTrack && {alive _round}) then { _spallTrack = []; _spallTrackID = []; - private["_args"]; + private ["_args"]; _args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID, (getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))), (getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")), diff --git a/addons/frag/functions/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf index 84304513e0..4270e15996 100644 --- a/addons/frag/functions/fnc_addTrack.sqf +++ b/addons/frag/functions/fnc_addTrack.sqf @@ -1,23 +1,20 @@ #include "script_component.hpp" -private ["_color", "_data", "_index", "_obj", "_objSpd", "_origin", "_positions"]; - if (GVAR(autoTrace)) then { [] call FUNC(startTracing); }; // setAccTime 0.05; -_index = (count GVAR(traces)); -_obj = _this select 1; -_origin = _this select 0; -_color = [1,0,0,1]; +private _index = count GVAR(traces); +params ["_origin", "_obj"]; +private _color = [1,0,0,1]; if((count _this) > 2) then { _color = _this select 2; }; -_positions = []; -_objSpd = vectorMagnitude (velocity _obj); +private _positions = []; +private _objSpd = vectorMagnitude (velocity _obj); _positions set[(count _positions), [(getPos _obj), _objSpd]]; -_data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; +private _data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; GVAR(traces) set[_index, _data]; [DFUNC(trackTrace), 0, [_obj, _index, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_doExplosions.sqf b/addons/frag/functions/fnc_doExplosions.sqf index 41d546b78f..03ad4d1dec 100644 --- a/addons/frag/functions/fnc_doExplosions.sqf +++ b/addons/frag/functions/fnc_doExplosions.sqf @@ -1,18 +1,12 @@ //fnc_doExplosions.sqf #include "script_component.hpp" -private ["_params", "_explosions", "_index", "_i", "_exp", "_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; -_params = _this select 0; -_explosions = _params select 0; -_index = _params select 1; +params ["_args"]; +_args params ["_explosions", "_index"]; + for "_i" from _index to ((_index+2) min (count _explosions)) do { - _exp = _explosions select _i; - _refExp = _exp select 0; - _bpos = _exp select 1; - _hit = _exp select 2; - _distance = _exp select 3; - _indirectHitRange = _exp select 4; - _depth = _exp select 5; + private _exp = _explosions select _i; + _exp params ["_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; _refExp createVehicle (ASLtoATL _bpos); // if(_hit >= 150 && _distance > _indirectHitRange) then { // [_bpos, _refExp, _depth] call FUNC(doReflections); diff --git a/addons/frag/functions/fnc_doReflections.sqf b/addons/frag/functions/fnc_doReflections.sqf index fa30aba95d..de5bac1b62 100644 --- a/addons/frag/functions/fnc_doReflections.sqf +++ b/addons/frag/functions/fnc_doReflections.sqf @@ -1,18 +1,16 @@ //fnc_doReflections.sqf #include "script_component.hpp" -private ["_pos", "_ammo", "_depth", "_hit", "_range", "_hitFactor", "_indirectHitRange", "_indirectHit", "_testParams"]; +params ["_pos", "_ammo"]; -_pos = _this select 0; -_ammo = _this select 1; -_depth = 1; +private _depth = 1; if(count _this > 2) then { _depth = _this select 2; }; // TEST_ICONS pushBack [_pos, format["EXP!", _hit, _range, _hitFactor]]; if(_depth <= 2) then { - _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); - _indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit"); - _testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0]; + private _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); + private _indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit"); + private _testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0]; [DFUNC(findReflections), 0, _testParams] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 59eeb6ef1f..83f4518a03 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -2,46 +2,41 @@ #include "script_component.hpp" // ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; -private ["_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"]; +params ["_hitData"]; +private _initialData = GVAR(spallHPData) select (_hitData select 0); +private _hpData = (_hitData select 1) select (_this select 1); -_hitData = _this select 0; -_initialData = GVAR(spallHPData) select (_hitData select 0); -_hpData = (_hitData select 1) select (_this select 1); - - -_object = _hpData select 0; +_hpData params ["_object"]; _object removeEventHandler ["hitPart", _initialData select 0]; -_foundObjects = _initialData select 7; -_index = _foundObjects find _object; +private _foundObjects = _initialData select 7; +private _index = _foundObjects find _object; if(_index != -1) then { - _foundObjecsts set[_index, nil]; + _foundObjects set[_index, nil]; }; -_roundType = (_initialData select 2); -_round = (_initialData select 3); -_object = (_initialData select 1); +_initialData params ["", "_object", "_roundType", "_round"]; -_caliber = getNumber(configFile >> "CfgAmmo" >> _roundType >> "caliber"); -_explosive = getNumber(configFile >> "CfgAmmo" >> _roundType >> "explosive"); -_idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); +private _caliber = getNumber(configFile >> "CfgAmmo" >> _roundType >> "caliber"); +private _explosive = getNumber(configFile >> "CfgAmmo" >> _roundType >> "explosive"); +private _idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); -_alive = true; -if(!alive _round && (_initialData select 6) == 1) then { +private _alive = true; +if(!alive _round && (_initialData select 6) isEqualTo 1) then { _alive = false; }; if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { // ACE_player sideChat format["BBBB"]; - _exit = false; - _vm = 1; - _velocity = _initialData select 5; + private _exit = false; + private _vm = 1; + private _velocity = _initialData select 5; - _oldVelocity = vectorMagnitude _velocity; - _curVelocity = vectorMagnitude (velocity _round); + private _oldVelocity = vectorMagnitude _velocity; + private _curVelocity = vectorMagnitude (velocity _round); if(alive _round) then { - _diff = _velocity vectorDiff (velocity _round); - _polar = _diff call CBA_fnc_vect2polar; + private _diff = _velocity vectorDiff (velocity _round); + private _polar = _diff call CBA_fnc_vect2polar; // ACE_player sideChat format["polar: %1", _polar]; if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then { if(_caliber < 2.5) then { @@ -53,12 +48,12 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { }; }; if(!_exit) then { - _unitDir = vectorNormalized _velocity; - _pos = _hpData select 3; - _spallPos = nil; + private _unitDir = vectorNormalized _velocity; + private _pos = _hpData select 3; + private _spallPos = nil; for "_i" from 0 to 100 do { - _pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i)); - _pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1))); + private _pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i)); + private _pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1))); // _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)]; // diag_log text format["b: %1", _blah]; @@ -71,29 +66,29 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { }; }; if(!isNil "_spallPos") then { - _spallPolar = _velocity call CBA_fnc_vect2polar; + private _spallPolar = _velocity call CBA_fnc_vect2polar; if(_explosive > 0) then { // ACE_player sideChat format["EXPLOSIVE!"]; - _warn = false; - _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(CHARGE)); + private _warn = false; + private _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(CHARGE)); if(_c == 0) then { _c = 1; _warn = true;}; - _m = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(METAL)); + private _m = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(METAL)); if(_m == 0) then { _m = 2; _warn = true;}; - _k = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_K)); + private _k = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_K)); if(_k == 0) then { _k = 1/2; _warn = true;}; - _gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_C)); + private _gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_C)); if(_gC == 0) then { _gC = 2440; _warn = true;}; if(_warn) then { ACE_LOGWARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_roundType); //TODO: turn this off when we get closer to release }; - _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; + private _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; _spallPolar set[0, _fragPower*0.66]; }; - _fragTypes = [ + private _fragTypes = [ QGVAR(spall_small), QGVAR(spall_small), QGVAR(spall_small), QGVAR(spall_small),QGVAR(spall_medium),QGVAR(spall_medium),QGVAR(spall_medium), QGVAR(spall_medium), QGVAR(spall_large), QGVAR(spall_large), QGVAR(spall_huge), @@ -102,21 +97,21 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { ]; // diag_log text format["SPALL POWER: %1", _spallPolar select 0]; - _spread = 15+(random 25); - _spallCount = 5+(random 10); + private _spread = 15+(random 25); + private _spallCount = 5+(random 10); for "_i" from 1 to _spallCount do { - _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); - _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); + private _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); + private _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); if(abs _elev > 90) then { _dir = _dir + 180; }; _dir = _dir % 360; - _vel = (_spallPolar select 0)*0.33*_vm; + private _vel = (_spallPolar select 0)*0.33*_vm; _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - _fragType = round (random ((count _fragTypes)-1)); - _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; + private _fragType = round (random ((count _fragTypes)-1)); + private _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; @@ -127,18 +122,18 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { _spread = 5+(random 5); _spallCount = 3+(random 5); for "_i" from 1 to _spallCount do { - _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); - _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); + private _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); + private _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); if(abs _elev > 90) then { _dir = _dir + 180; }; _dir = _dir % 360; - _vel = (_spallPolar select 0)*0.55*_vm; + private _vel = (_spallPolar select 0)*0.55*_vm; _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - _fragType = round (random ((count _fragTypes)-1)); - _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; + private _fragType = round (random ((count _fragTypes)-1)); + private _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index d0c5c1ceec..cc123641d3 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -1,25 +1,18 @@ //fnc_findReflections.sqf #include "script_component.hpp" -private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange", "_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", "_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec", "_zAng"]; +private ["_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec", "_zAng"]; BEGIN_COUNTER(fnc_findReflections); -_params = _this select 0; -_pos = _params select 0; -_explosiveInfo = _params select 1; -_los = _params select 2; -_nlos = _params select 3; -_zIndex = _params select 4; -_depth = _params select 5; -_rand = _params select 6; +params ["_args"]; +_args params ["_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_rand"]; -_split = 15; -_radi = (360/_split*_depth); +private _split = 15; +private _radi = (360/_split*_depth); // player sideChat format["p: %1", _explosiveInfo]; -_indirectHitRange = _explosiveInfo select 0; -_indirectHit = _explosiveInfo select 1; -_distanceCount = (floor _indirectHitRange*4) min 100; +_explosiveInfo params ["_indirectHitRange", "_indirectHit"]; +private _distanceCount = (floor _indirectHitRange*4) min 100; if(_zIndex < 5) then { _lastPos = _pos; diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 299644af6d..2c04528492 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -11,42 +11,39 @@ if(!isServer) exitWith { }; BEGIN_COUNTER(frago); // _startTime = diag_tickTime; -private ["_startTime", "_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_boundingBox", "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", "_currentCount", "_count", "_vecVar", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", "_sectorSize", "_sectorOffset", "_i", "_randomDir", "_endTime", "_target"]; +private ["_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_boundingBox", "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", "_currentCount", "_count", "_vecVar", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", "_sectorSize", "_sectorOffset", "_i", "_randomDir", "_endTime", "_target"]; -_round = _this select 0; -_lastPos = _this select 1; -_lastVel = _this select 2; -_shellType = _this select 3; -_gun = nil; +params ["_round", "_lastPos", "_lastVel", "_shellType"]; +private _gun = nil; if((count _this) > 5) then { _gun = _this select 5; }; -_fragTypes = [ - QGVAR(tiny), QGVAR(tiny), QGVAR(tiny), - QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(tiny_HD), - QGVAR(small),QGVAR(small),QGVAR(small),QGVAR(small), - QGVAR(small_HD),QGVAR(small_HD),QGVAR(small_HD),QGVAR(small_HD), - QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD) - ]; +private _fragTypes = [ + QGVAR(tiny), QGVAR(tiny), QGVAR(tiny), + QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(tiny_HD), + QGVAR(small),QGVAR(small),QGVAR(small),QGVAR(small), + QGVAR(small_HD),QGVAR(small_HD),QGVAR(small_HD),QGVAR(small_HD), + QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD) +]; -_warn = false; +private _warn = false; if(isArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES))) then { _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES)); } else { _warn = true; }; -_atlPos = ASLtoATL _lastPos; +private _atlPos = ASLtoATL _lastPos; -_isArmed = true; +private _isArmed = true; if(!isNil "_gun") then { _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); _isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist); }; _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange"); -_fragRange = 20*_indirectHitRange*4; +_fragRange = 20 * _indirectHitRange * 4; // _c = 185; // grams of comp-b // _m = 210; // grams of fragmentating metal // _k = 3/5; // spherical K factor @@ -72,9 +69,9 @@ if(_warn) then { }; _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; -_fragPower = _fragPower*0.8; // Gunery equation is for a non-fragmenting metal, imperical value of 80% represents fragmentation +_fragPower = _fragPower * 0.8; // Gunery equation is for a non-fragmenting metal, imperical value of 80% represents fragmentation -_fragPowerRandom = _fragPower*0.5; +_fragPowerRandom = _fragPower * 0.5; if((_atlPos select 2) < 0.5) then { _lastPos set[2, (_lastPos select 2)+0.5]; }; @@ -123,7 +120,7 @@ if(_isArmed && (count _objects) > 0) then { _bbX = (abs((_boundingBox select 0) select 0))+((_boundingBox select 1) select 0); _bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1); _bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2); - _cubic = _bbX*_bbY*_bbZ; + _cubic = _bbX * _bbY * _bbZ; if(_cubic > 1) then { _doRandom = true; @@ -181,7 +178,7 @@ if(_isArmed && (count _objects) > 0) then { if(_fragCount > MAX_FRAG_COUNT) exitWith {}; } forEach _objects; if(_fragCount > MAX_FRAG_COUNT) exitWith {}; - _randomCount = ((ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0)+20; + _randomCount = ((ceil((MAX_FRAG_COUNT - _fragCount)*0.1)) max 0)+20; _sectorSize = 360 / (_randomCount max 1); // _doRandom = false; if(_doRandom) then { diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf index 6af62e3f21..722590a391 100644 --- a/addons/frag/functions/fnc_masterPFH.sqf +++ b/addons/frag/functions/fnc_masterPFH.sqf @@ -15,12 +15,12 @@ if (!GVAR(enabled)) exitWith {}; -private["_gcIndex", "_iter"]; +private ["_gcIndex", "_iter"]; _gcIndex = []; _iter = 0; while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (count GVAR(objects))) } } do { - private["_object", "_args"]; + private ["_object", "_args"]; if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then { GVAR(lastIterationIndex) = 0; }; @@ -38,7 +38,7 @@ while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (cou }; // clean up dead object references -private["_deletionCount", "_deleteIndex"]; +private ["_deletionCount", "_deleteIndex"]; _deletionCount = 0; { TRACE_1("GC Projectile", _x); diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf index 033ef644ba..cbbd75b633 100644 --- a/addons/frag/functions/fnc_pfhRound.sqf +++ b/addons/frag/functions/fnc_pfhRound.sqf @@ -32,7 +32,7 @@ _this set[1, (getPosASL _round)]; _this set[2, (velocity _round)]; if(_doSpall) then { - private["_scale"]; + private ["_scale"]; _scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1; [_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack); }; diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf index dd369380b3..91c7dee511 100644 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ b/addons/frag/functions/fnc_spallTrack.sqf @@ -1,31 +1,27 @@ //fnc_spallTrack.sqf #include "script_component.hpp" -private ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds", "_delta", "_curPos", "_velocity", "_velocityStep", "_forwardPos", "_intersectsWith", "_index", "_hpId", "_data"]; -_round = _this select 0; -_multiplier = _this select 1; -_foundObjects = _this select 2; -_foundObjectHPIds = _this select 3; +params ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds"]; -_delta = (1/diag_fps) * _multiplier; -_curPos = getPosASL _round; -_velocity = velocity _round; +private _delta = (1/diag_fps) * _multiplier; +private _curPos = getPosASL _round; +private _velocity = velocity _round; -_velocityStep = _velocity vectorMultiply _delta; -_forwardPos = _curPos vectorAdd _velocityStep; +private _velocityStep = _velocity vectorMultiply _delta; +private _forwardPos = _curPos vectorAdd _velocityStep; -_intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; +private _intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; if (count _intersectsWith > 0) then { // player sideChat format["inter: %1", _intersectsWith]; { if(!(_x in _foundObjects)) then { // diag_log text format["Adding HP: %1", _x]; - _index = (count GVAR(spallHPData)); - _hpId = _x addEventHandler ["hitPart", compile format["[%1, _this] call " + QFUNC(spallHP), _index]]; + private _index = count GVAR(spallHPData); + private _hpId = _x addEventHandler ["hitPart", compile format["[%1, _this] call " + QFUNC(spallHP), _index]]; _foundObjects set[(count _foundObjects), _x]; _foundObjectHPIds set[(count _foundObjectHPIds), _hpId]; - _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; + private _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; GVAR(spallHPData) set[_index, _data]; }; } forEach _intersectsWith; diff --git a/addons/frag/functions/fnc_trackTrace.sqf b/addons/frag/functions/fnc_trackTrace.sqf index d9407c3f8d..d57eaa8c5c 100644 --- a/addons/frag/functions/fnc_trackTrace.sqf +++ b/addons/frag/functions/fnc_trackTrace.sqf @@ -1,14 +1,12 @@ #include "script_component.hpp" -private ["_params", "_tracerObj", "_index", "_positions", "_data"]; -_params = _this select 0; -_tracerObj = _params select 0; -_index = _params select 1; +params ["_args"]; +_args params ["_tracerObj", "_index"]; if (alive _tracerObj && (count GVAR(traces)) > 0) then { - _data = GVAR(traces) select _index; - _positions = _data select 4; - _positions set [(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]]; + private _data = GVAR(traces) select _index; + private _positions = _data select 4; + _positions pushBack [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]; } else { [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index ceeeb9991d..ec26635f02 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -21,11 +21,11 @@ params ["_text", "_icon", "_sPos", "_textSettings"]; TRACE_2("Icon",_text,_sPos); if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { - private _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); - GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); + private _displayNum = [[46, 12] select visibleMap, 91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); + GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021 + GVAR(iconCount)]); if (GVAR(useCursorMenu)) then { - ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; - ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + ((finddisplay _displayNum) displayctrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay _displayNum) displayctrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; }; }; private _ctrl = GVAR(iconCtrls) select GVAR(iconCount); @@ -44,9 +44,9 @@ _text = if (GVAR(UseListMenu)) then { GVAR(iconCount) = GVAR(iconCount) + 1; private _pos = if (GVAR(UseListMenu)) then { - [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.20*SafeZoneW, 0.035*SafeZoneW] + [(_sPos select 0) - (0.0095 * SafeZoneW), (_sPos select 1) - (0.0095 * SafeZoneW), 0.20 * SafeZoneW, 0.035 * SafeZoneW] } else { - [(_sPos select 0)-(0.0750*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.15*SafeZoneW, 0.100*SafeZoneW] + [(_sPos select 0) - (0.0750 * SafeZoneW), (_sPos select 1) - (0.0095 * SafeZoneW), 0.15 * SafeZoneW, 0.100 * SafeZoneW] }; if (GVAR(cursorKeepCentered) && {uiNamespace getVariable [QGVAR(cursorMenuOpened),false]}) then { diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index 7b8ad69ee0..65fecebbdc 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -19,8 +19,7 @@ params ["_vehicle", "_player"]; -private "_actions"; -_actions = []; +private _actions = []; { private _unit = _x; diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index 53a846e1c3..125af18e09 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -22,8 +22,7 @@ params ["_unit", "_target"]; [_unit, "GestureGo"] call EFUNC(common,doGesture); -private "_chance"; -_chance = [0.5, 0.8] select (count weapons _unit > 0); +private _chance = [0.5, 0.8] select (count weapons _unit > 0); { if (count weapons _x == 0 && {random 1 < _chance}) then { diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 180c01fba9..b1c7789ec3 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -16,15 +16,13 @@ */ #include "script_component.hpp" -private "_info"; -_info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor); +private _info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor); _info params ["_house", "_door"]; if (isNull _house) exitWith {}; -private "_getDoorAnimations"; -_getDoorAnimations = [_house, _door] call FUNC(getDoorAnimations); +private _getDoorAnimations = [_house, _door] call FUNC(getDoorAnimations); _getDoorAnimations params ["_animations", "_lockedVariable"]; @@ -49,8 +47,7 @@ GVAR(usedScrollWheel) = false; // didn't use incremental opening. Just do animation normally. if !(GVAR(usedScrollWheel)) then { - private "_phase"; - _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); + private _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); {_house animate [_x, _phase]; false} count _animations; }; diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index abd4ec50aa..6bc70b7445 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -22,13 +22,11 @@ params ["_unit"]; [_unit, "GestureGo"] call EFUNC(common,doGesture); -private "_chance"; -_chance = [0.5, 0.8] select (count weapons _unit > 0); +private _chance = [0.5, 0.8] select (count weapons _unit > 0); { if (count weapons _x == 0 && {random 1 < _chance}) then { - private "_position"; - _position = getPosASL _unit vectorAdd (eyeDirection _unit vectorMultiply SEND_DISTANCE); + private _position = getPosASL _unit vectorAdd (eyeDirection _unit vectorMultiply SEND_DISTANCE); _position set [2, 0]; [QGVAR(sendAway), [_x, _position], [_x]] call CBA_fnc_targetEvent; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index 821abda14e..9ea1f26cba 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -26,8 +26,7 @@ params ["_leftClick", "_rightClick", ["_scroll", ""]]; disableSerialization; -private "_display"; -_display = uiNamespace getVariable ["ACE_Helper_Display", objNull]; +private _display = uiNamespace getVariable ["ACE_Helper_Display", objNull]; if (isNull _display) exitWith {}; diff --git a/addons/javelin/functions/fnc_onFired.sqf b/addons/javelin/functions/fnc_onFired.sqf index 9cc8b95ad4..220ddc37f0 100644 --- a/addons/javelin/functions/fnc_onFired.sqf +++ b/addons/javelin/functions/fnc_onFired.sqf @@ -6,9 +6,7 @@ PARAMS_2(_shooter,_weapon); // Bail on not missile or javelin PFEH not running if ((_shooter != ACE_player) || {(GVAR(pfehID) == -1)}) exitWith { false }; -private ["_configs"]; - -_configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; +private _configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith {}; __JavelinIGUITargeting ctrlShow false; diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 6388a9fe1e..dede3ae69c 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -5,11 +5,11 @@ TRACE_1("enter", _this); #define __TRACKINTERVAL 0 // how frequent the check should be. #define __LOCKONTIME 3 // Lock on won't occur sooner -private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"]; -private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"]; -private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"]; -private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"]; -private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"]; +private ["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"]; +private ["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"]; +private ["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"]; +private ["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"]; +private ["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"]; _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; @@ -35,7 +35,7 @@ _soundTime = _args select 4; _randomLockInterval = _args select 5; _fireDisabledEH = _args select 6; -private["_ammo", "_magazineConfig", "_weaponConfig"]; +private ["_ammo", "_magazineConfig", "_weaponConfig"]; _weaponConfig = configProperties [configFile >> "CfgWeapons" >> (currentWeapon _currentShooter), QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; _magazineConfig = if ((currentMagazine _currentShooter) != "") then { _ammo = getText (configFile >> "CfgMagazines" >> (currentMagazine _currentShooter) >> "ammo"); @@ -123,7 +123,7 @@ _offsetY = __OffsetY; __JavelinIGUITargeting ctrlShow true; __JavelinIGUITargetingConstrains ctrlShow true; -_zamerny = if (_currentTarget isKindOf "CAManBase") then {_currentTarget selectionPosition "body"} else {_currentTarget selectionPosition "zamerny"}; +_zamerny = _currentTarget selectionPosition (["zamerny", "body"] select (_currentTarget isKindOf "CAManBase")); _randomPosWithinBounds = [(_zamerny select 0) + 1 - (random 2.0),(_zamerny select 1) + 1 - (random 2.0),(_zamerny select 2) + 0.5 - (random 1.0)]; _apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds); @@ -202,17 +202,17 @@ if (isNull _newTarget) then { _minX = ((_bpos select 0) + _offsetX) max _constraintLeft; _minY = ((_bpos select 1) + _offsetY) max _constraintTop; - _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH); - _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH); + _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025 * (3 / 4) * SafezoneH); + _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025 * SafezoneH); TRACE_4("", _boundsInput, _bpos, _minX, _minY); - __JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY]; - __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY]; - __JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY]; - __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY]; + __JavelinIGUITargetingGateTL ctrlSetPosition [_minX, _minY]; + __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX, _minY]; + __JavelinIGUITargetingGateBL ctrlSetPosition [_minX, _maxY]; + __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX, _maxY]; - {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR]; + {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL, __JavelinIGUITargetingGateTR, __JavelinIGUITargetingGateBL, __JavelinIGUITargetingGateBR]; _currentShooter setVariable["ace_missileguidance_target", _currentTarget, false]; @@ -241,8 +241,8 @@ if (isNull _newTarget) then { _minX = ((_bpos select 0) + _offsetX) max _constraintLeft; _minY = ((_bpos select 1) + _offsetY) max _constraintTop; - _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH); - _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH); + _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025 * (3 / 4) * SafezoneH); + _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025 * SafezoneH); TRACE_4("", _boundsInput, _bpos, _minX, _minY); @@ -272,7 +272,7 @@ if (isNull _newTarget) then { __JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false; - _currentShooter setVariable ["ace_missileguidance_target",nil, false]; + _currentShooter setVariable ["ace_missileguidance_target", nil, false]; // Disallow fire _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); diff --git a/addons/javelin/functions/fnc_onOpticUnload.sqf b/addons/javelin/functions/fnc_onOpticUnload.sqf index ef5394cb6c..221fe3b5f6 100644 --- a/addons/javelin/functions/fnc_onOpticUnload.sqf +++ b/addons/javelin/functions/fnc_onOpticUnload.sqf @@ -1,7 +1,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" TRACE_1("enter", _this); -private["_args", "_disableFireEH"]; +private ["_args", "_disableFireEH"]; // uiNameSpace setVariable ['ACE_RscOptics_javelin',nil]; diff --git a/addons/kestrel4500/functions/fnc_buttonPressed.sqf b/addons/kestrel4500/functions/fnc_buttonPressed.sqf index a051f6b1b6..788b7d72e0 100644 --- a/addons/kestrel4500/functions/fnc_buttonPressed.sqf +++ b/addons/kestrel4500/functions/fnc_buttonPressed.sqf @@ -103,8 +103,7 @@ switch (_this) do { case 6: { // Backlight }; case 7: { // Exit - private ["_exit"]; - _exit = true; + private _exit = true; if (GVAR(referenceHeadingMenu) == 1) then { GVAR(referenceHeadingMenu) = 0; _exit = false; diff --git a/addons/kestrel4500/functions/fnc_dayOfWeek.sqf b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf index f63a3969b0..356b10da63 100644 --- a/addons/kestrel4500/functions/fnc_dayOfWeek.sqf +++ b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf @@ -16,10 +16,9 @@ * Public: No */ #include "script_component.hpp" -private "_table"; params ["_year", "_month", "_day"]; -_table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]; +private _table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]; if (_month < 3) then { _year = _year - 1; }; diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf index 28de70a13d..0cf3234d1e 100644 --- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf +++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf @@ -62,8 +62,7 @@ GVAR(Overlay) = true; if (diag_tickTime > GVAR(updateTimer)) then { GVAR(updateTimer) = diag_tickTime + 1; - private ["_outputData"]; - _outputData = [] call FUNC(generateOutputData); + private _outputData = [] call FUNC(generateOutputData); 3 cutRsc ["RscKestrel4500", "PLAIN", 1, false]; _outputData params [ diff --git a/addons/kestrel4500/functions/fnc_updateDisplay.sqf b/addons/kestrel4500/functions/fnc_updateDisplay.sqf index 75c0db2e86..a307e9fcd1 100644 --- a/addons/kestrel4500/functions/fnc_updateDisplay.sqf +++ b/addons/kestrel4500/functions/fnc_updateDisplay.sqf @@ -18,9 +18,7 @@ #define __ctrlCenterLine3 (__dsp displayCtrl 74602) #define __ctrlCenterLine4 (__dsp displayCtrl 74603) -private ["_outputData"]; - -_outputData = [] call FUNC(generateOutputData); +private _outputData = [] call FUNC(generateOutputData); { ctrlSetText [_x , _outputData select _forEachIndex]; diff --git a/addons/kestrel4500/functions/fnc_updateImpellerState.sqf b/addons/kestrel4500/functions/fnc_updateImpellerState.sqf index 75a0d10f4c..a746a98835 100644 --- a/addons/kestrel4500/functions/fnc_updateImpellerState.sqf +++ b/addons/kestrel4500/functions/fnc_updateImpellerState.sqf @@ -14,9 +14,7 @@ */ #include "script_component.hpp" -private ["_windSpeed"]; - -_windSpeed = call FUNC(measureWindSpeed); +private _windSpeed = call FUNC(measureWindSpeed); GVAR(ImpellerState) = GVAR(ImpellerState) + (ceil(_windSpeed) min 1) max _windSpeed; if (GVAR(ImpellerState) > 1000) then { GVAR(ImpellerState) = 0 }; diff --git a/addons/laser/functions/fnc_checkLos.sqf b/addons/laser/functions/fnc_checkLos.sqf index 0cbeffaea2..0f02305ff1 100644 --- a/addons/laser/functions/fnc_checkLos.sqf +++ b/addons/laser/functions/fnc_checkLos.sqf @@ -1,21 +1,18 @@ #include "script_component.hpp" -private ["_pos1", "_pos2", "_spacing", "_vectorTo", "_x", "_y", "_z", "_distance", "_count", "_return", "_alt", "_pos", "_designator", "_seeker"]; -_pos1 = _this select 0; -_pos2 = _this select 1; -_designator = _this select 2; -_seeker = _this select 3; -_spacing = 100; +params ["_pos1", "_pos2", "_designator", "_seeker"] + +private _spacing = 100; if((count _this) > 4) then { _spacing = _this select 4; }; -_return = true; -_vectorTo = [_pos2, _pos1] call BIS_fnc_vectorFromXToY; +private _return = true; +private _vectorTo = [_pos2, _pos1] call BIS_fnc_vectorFromXToY; -_x = (_vectorTo select 0)*0.25; -_y = (_vectorTo select 1)*0.25; -_z = (_vectorTo select 2)*0.25; +private _x = (_vectorTo select 0)*0.25; +private _y = (_vectorTo select 1)*0.25; +private _z = (_vectorTo select 2)*0.25; _pos2 = [(_pos2 select 0) + _x, (_pos2 select 1) + _y, (_pos2 select 2) + _z]; diff --git a/addons/laser/functions/fnc_findStrongestRay.sqf b/addons/laser/functions/fnc_findStrongestRay.sqf index cd29768fd3..e863fb4d11 100644 --- a/addons/laser/functions/fnc_findStrongestRay.sqf +++ b/addons/laser/functions/fnc_findStrongestRay.sqf @@ -1,13 +1,12 @@ #include "script_component.hpp" -private["_checkPos", "_i", "_largest", "_largestSpot", "_list", "_outliers", "_remainingSpots", "_samplePos", "_spot", "_spots", "_testPos"]; -_list = _this select 0; -_checkPos = _this select 1; -_spots = []; -_outliers = []; -_spot = []; -_testPos = (_list select 0) select 0; + +params ["_list", "_checkPos"]; +private _spots = []; +private _outliers = []; +private _spot = []; +(_list select 0) params ["_testPos"]; { - _samplePos = _x select 0; + _x params ["_samplePos"]; if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { if(_samplePos distance _testPos < 2) then { _spot pushBack _samplePos; @@ -20,12 +19,12 @@ _spots pushBack _spot; if(count _outliers > 0) then { for "_i" from 1 to 3 do { - _remainingSpots = _outliers; + private _remainingSpots = _outliers; _outliers = []; _spot = []; _testPos = (_remainingSpots select 0); { - _samplePos = _x; + private _samplePos = _x; if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { if(_samplePos distance _testPos < 2) then { _spot pushBack _samplePos; @@ -37,11 +36,11 @@ if(count _outliers > 0) then { _spots pushBack _spot; }; }; -_largest = 0; -_largestSpot = []; +private _largest = 0; +private _largestSpot = []; { - if((count _x) > _largest) then { - _largest = (count _x); + if(count _x > _largest) then { + _largest = count _x; _largestSpot = _x; }; } forEach _spots; diff --git a/addons/laser/functions/fnc_handleLaserOff.sqf b/addons/laser/functions/fnc_handleLaserOff.sqf index 7abc84e665..9a83120934 100644 --- a/addons/laser/functions/fnc_handleLaserOff.sqf +++ b/addons/laser/functions/fnc_handleLaserOff.sqf @@ -1,8 +1,7 @@ //fnc_handleLaserOff.sqf #include "script_component.hpp" -private ["_uuid"]; -_uuid = _this select 0; +params ["_uuid"]; if ([GVAR(laserEmitters), _uuid] call CBA_fnc_hashHasKey) then { [GVAR(laserEmitters), _uuid] call CBA_fnc_hashRem; }; diff --git a/addons/laser/functions/fnc_handleLaserOn.sqf b/addons/laser/functions/fnc_handleLaserOn.sqf index da0487c21e..243023d8aa 100644 --- a/addons/laser/functions/fnc_handleLaserOn.sqf +++ b/addons/laser/functions/fnc_handleLaserOn.sqf @@ -1,7 +1,5 @@ //fnc_handleLaserOn.sqf #include "script_component.hpp" -private ["_uuid", "_args"]; -_uuid = _this select 0; -_args = _this select 1; +params ["_uuid", "_args"]; [GVAR(laserEmitters), _uuid, _args] call CBA_fnc_hashSet; diff --git a/addons/laser/functions/fnc_keyLaserCodeDown.sqf b/addons/laser/functions/fnc_keyLaserCodeDown.sqf index d428a3b81c..a75487193d 100644 --- a/addons/laser/functions/fnc_keyLaserCodeDown.sqf +++ b/addons/laser/functions/fnc_keyLaserCodeDown.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private["_oldLaserCode", "_laserCode"]; +private ["_oldLaserCode", "_laserCode"]; _oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; if(_oldLaserCode > ACE_DEFAULT_LASER_CODE) then { diff --git a/addons/laser/functions/fnc_keyLaserCodeUp.sqf b/addons/laser/functions/fnc_keyLaserCodeUp.sqf index 926bce5c26..93001a06fd 100644 --- a/addons/laser/functions/fnc_keyLaserCodeUp.sqf +++ b/addons/laser/functions/fnc_keyLaserCodeUp.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private["_oldLaserCode", "_laserCode"]; +private ["_oldLaserCode", "_laserCode"]; _oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; _laserCode = _oldLaserCode + 1; diff --git a/addons/laser/functions/fnc_laserOff.sqf b/addons/laser/functions/fnc_laserOff.sqf index 9a3e663d14..8e9792f0d4 100644 --- a/addons/laser/functions/fnc_laserOff.sqf +++ b/addons/laser/functions/fnc_laserOff.sqf @@ -11,6 +11,5 @@ #include "script_component.hpp" -private ["_uuid"]; -_uuid = _this select 0; +params ["_uuid"]; ["ace_laserOff", [_uuid]] call CBA_fnc_globalEvent; diff --git a/addons/laser/functions/fnc_laserOn.sqf b/addons/laser/functions/fnc_laserOn.sqf index a9e5a00d4c..644059c406 100644 --- a/addons/laser/functions/fnc_laserOn.sqf +++ b/addons/laser/functions/fnc_laserOn.sqf @@ -16,8 +16,7 @@ #include "script_component.hpp" -private ["_uuid", "_args"]; -_uuid = format["%1%2%3", floor diag_tickTime, floor random 1000, floor random 10000]; -_args = [_uuid, _this]; +private _uuid = format["%1%2%3", floor diag_tickTime, floor random 1000, floor random 10000]; +private _args = [_uuid, _this]; ["ace_laserOn", _args] call CBA_fnc_globalEvent; _uuid; diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index ba3df3376a..c0805b1e6c 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -2,12 +2,9 @@ #include "script_component.hpp" TRACE_1("enter", _this); -private["_args", "_laserTarget", "_pos", "_shooter", "_uuid"]; //TRACE_1("enter", _this); -_args = _this select 0; -_laserTarget = _args select 0; -_shooter = _args select 1; -_uuid = _args select 2; +params ["_args"]; +_args params ["_laserTarget", "_shooter", "_uuid"]; if(isNull _laserTarget || !alive _shooter) exitWith { [(_this select 1)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/laser/functions/fnc_laser_init.sqf b/addons/laser/functions/fnc_laser_init.sqf index 2e61eb3587..23f84c0bf5 100644 --- a/addons/laser/functions/fnc_laser_init.sqf +++ b/addons/laser/functions/fnc_laser_init.sqf @@ -3,7 +3,7 @@ TRACE_1("enter", _this); PARAMS_1(_laserTarget); -private["_uuid"]; +private ["_uuid"]; // Add the target to the global targets array // Everyone tracks them diff --git a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf index 8c60cd3c33..3161b2a220 100644 --- a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf +++ b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private["_laserCode"]; +private ["_laserCode"]; _laserCode = ACE_player getVariable[QGVAR(code), ACE_DEFAULT_LASER_CODE]; if(!isNil "_laserCode") then { diff --git a/addons/laser/functions/fnc_rotateVectLine.sqf b/addons/laser/functions/fnc_rotateVectLine.sqf index f748975dab..76ff42c66c 100644 --- a/addons/laser/functions/fnc_rotateVectLine.sqf +++ b/addons/laser/functions/fnc_rotateVectLine.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" -private["_d", "_map", "_p", "_theta", "_u"]; +private ["_d", "_map", "_p", "_theta", "_u"]; _map = _this select 0; _theta = _this select 1; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 6b878ea8e4..b6abefa691 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -18,7 +18,7 @@ private ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_excludes", "_bucketIndex", "_finalPos", "_owner", "_obj", "_x", "_method"]; private ["_emitterWavelength", "_laserCode", "_divergence", "_laser", "_res", "_bucketPos", "_bucketList", "_c", "_forEachIndex", "_index"]; private ["_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; -private["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; +private ["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; _pos = _this select 0; _dir = vectorNormalized (_this select 1); diff --git a/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf b/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf index 5464e9711c..7de303dee7 100644 --- a/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf +++ b/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf @@ -12,7 +12,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private["_emmiter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; +private ["_emmiter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; _emmiter = _this select 0; _owner = _this select 1; diff --git a/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf b/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf index f05a0e2323..ba2e6a4100 100644 --- a/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf +++ b/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -private["_gunnerInfo", "_turretInfo"]; +private ["_gunnerInfo", "_turretInfo"]; params ["_emmiter"]; _gunnerInfo = [_emmiter, (currentWeapon _emmiter)] call CBA_fnc_getFirer; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index 545e975187..d77360ce49 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -18,7 +18,7 @@ TRACE_1("enter", _this); #define FCS_UPDATE_DELAY 1 FUNC(laserHudDesignatePFH) = { - private["_strongestResultPos", "_args", "_localLaserTarget", "_laserResultPosition", "_laserResult", "_shooter", "_vehicle", "_weapon", "_gunnerInfo", "_turretInfo", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir", "_result", "_resultPositions", "_firstResult", "_forceUpdateTime"]; + private ["_strongestResultPos", "_args", "_localLaserTarget", "_laserResultPosition", "_laserResult", "_shooter", "_vehicle", "_weapon", "_gunnerInfo", "_turretInfo", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir", "_result", "_resultPositions", "_firstResult", "_forceUpdateTime"]; params ["_args"]; _args params ["_shooter", "_localLaserTarget"]; _vehicle = vehicle _shooter; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index 9506a91fb5..219c70d372 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -16,8 +16,7 @@ GVAR(nearUnits) = []; // @todo. Maybe move to common? [{ - private "_nearUnits"; - _nearUnits = []; + private _nearUnits = []; { _nearUnits append crew _x; if (count _nearUnits > 10) exitWith { diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index 65c0932bb7..2bf617478d 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -15,19 +15,18 @@ * Public: No */ #include "script_component.hpp" -private ["_onFinish", "_onFailure"]; params ["_caller", "_target"]; if (!(_this call FUNC(canRefuelUAV))) exitWith {}; -_onFinish = { +private _onFinish = { (_this select 0) params ["_caller", "_target"]; _caller removeItem "ACE_UAVBattery"; playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10]; [QEGVAR(common,setFuel), [_target, 1], [_target]] call CBA_fnc_targetEvent; //setFuel is local }; -_onFailure = { +private _onFailure = { (_this select 0) params ["_caller", "_target"]; [_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); }; diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index f8a18438e9..f8403d81e5 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -22,10 +22,9 @@ params ["_target", "_player"]; private _unitMagazines = []; private _unitMagCounts = []; { - private "_xFullMagazineCount"; _x params ["_xClassname", "_xCount", "_xLoaded", "_xType"]; - _xFullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _xClassname >> "count"); + private _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 _xClassname}}) then { diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index ef0f08b24c..728126531e 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -26,7 +26,7 @@ if (!GVAR(enabled) || !visibleMap) exitWith {}; -private["_color", "_drawPosVariableName", "_group", "_grpName", "_pos", "_unitUID"]; +private ["_color", "_drawPosVariableName", "_group", "_grpName", "_pos", "_unitUID"]; params ["_mapHandle"]; diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf index dded0b1273..e4ec44837b 100644 --- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf +++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf @@ -16,11 +16,9 @@ */ #include "script_component.hpp" -private "_proximityPlayers"; - params ["_unit", "_range"]; -_proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range]; +private _proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range]; _proximityPlayers deleteAt (_proximityPlayers find _unit); _proximityPlayers append (crew vehicle _unit); _proximityPlayers diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 93ba23ed84..bf2030e6e7 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -55,10 +55,9 @@ if (isServer) then { if (hasInterface) then { _fnc_createEffect = { - private "_effect"; params ["_type", "_layer", "_default"]; - _effect = ppEffectCreate [_type, _layer]; + private _effect = ppEffectCreate [_type, _layer]; _effect ppEffectForceInNVG true; _effect ppEffectAdjust _default; _effect ppEffectCommit 0; @@ -108,7 +107,7 @@ GVAR(effectTimeBlood) = CBA_missionTime; // MAIN EFFECTS LOOP [{ - private["_bleeding", "_blood"]; + private ["_bleeding", "_blood"]; // Zeus interface is open or player is dead; disable everything if (!(isNull curatorCamera) or !(alive ACE_player)) exitWith { GVAR(effectUnconsciousCC) ppEffectEnable false; @@ -178,7 +177,7 @@ GVAR(lastHeartBeatSound) = CBA_missionTime; // HEARTRATE BASED EFFECTS [{ - private["_heartRate", "_interval", "_minTime", "_sound", "_strength", "_pain"]; + private ["_heartRate", "_interval", "_minTime", "_sound", "_strength", "_pain"]; _heartRate = ACE_player getVariable [QGVAR(heartRate), 70]; _pain = ACE_player getVariable [QGVAR(pain), 0]; if (GVAR(level) == 1) then { diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf index 3a611a116d..d86d90db7d 100644 --- a/addons/medical/functions/fnc_actionDiagnose.sqf +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -14,7 +14,6 @@ #include "script_component.hpp" -private "_genericMessages"; params ["_caller", "_target"]; private _genericMessages = [LSTRING(diagnoseMessage), [_target] call EFUNC(common,getName)]; diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 35ebfefebc..55a7a9ba51 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -14,7 +14,6 @@ #include "script_component.hpp" -private "_vehicle"; params ["_caller", "_target"]; if ([_target] call EFUNC(common,isAwake)) exitWith { @@ -27,4 +26,4 @@ if ([_target] call FUNC(isBeingDragged)) then { [_caller, _target] call EFUNC(dragging,dropObject); }; -_vehicle = [_caller, _target] call EFUNC(common,loadPerson); +private _vehicle = [_caller, _target] call EFUNC(common,loadPerson); diff --git a/addons/medical/functions/fnc_handleDamage_airway.sqf b/addons/medical/functions/fnc_handleDamage_airway.sqf index ace7041cb5..fb4c9fe83c 100644 --- a/addons/medical/functions/fnc_handleDamage_airway.sqf +++ b/addons/medical/functions/fnc_handleDamage_airway.sqf @@ -17,9 +17,8 @@ #include "script_component.hpp" -private "_bodyPartn"; params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"]; -_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); +private _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); if (_bodyPartn > 1) exitWith {}; diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index ec245b5b06..792f09e75d 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -77,7 +77,6 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t // handle the cached damages 3 frames later [{ - private ["_args", "_params"]; params ["_args", "_idPFH"]; _args params ["_unit", "_frameno"]; if (diag_frameno >= _frameno + 2) then { diff --git a/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf b/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf index d8d9be1506..8e249eee8f 100644 --- a/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf +++ b/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf @@ -17,8 +17,7 @@ #include "script_component.hpp" -private "_bodyPartn"; params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"]; -_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); +private _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); // TODO implement internal injuries diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index c8d08cbde2..6ca05a4228 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -13,7 +13,6 @@ #include "script_component.hpp" -private "_openWounds"; params ["_unit"]; if (!local _unit) exitWith {}; diff --git a/addons/medical/functions/fnc_handleLocal.sqf b/addons/medical/functions/fnc_handleLocal.sqf index 42e8a9b7b2..8bf3cd5e69 100644 --- a/addons/medical/functions/fnc_handleLocal.sqf +++ b/addons/medical/functions/fnc_handleLocal.sqf @@ -23,8 +23,7 @@ if (_local) then { }; if ((_unit getVariable ["ACE_isUnconscious",false]) && {count (_unit getVariable [QGVAR(unconsciousArguments), []]) >= 6}) then { - private "_arguments"; - _arguments = (_unit getVariable [QGVAR(unconsciousArguments), []]); + private _arguments = (_unit getVariable [QGVAR(unconsciousArguments), []]); _arguments set [2, CBA_missionTime]; [DFUNC(unconsciousPFH), 0.1, _arguments ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_isBeingCarried.sqf b/addons/medical/functions/fnc_isBeingCarried.sqf index b47c5e475f..26ce932901 100644 --- a/addons/medical/functions/fnc_isBeingCarried.sqf +++ b/addons/medical/functions/fnc_isBeingCarried.sqf @@ -17,9 +17,7 @@ params ["_target"]; -private "_owner"; - -_owner = _target getVariable [QEGVAR(common,owner), objNull]; +private _owner = _target getVariable [QEGVAR(common,owner), objNull]; if (isNull _owner) exitWith {false}; diff --git a/addons/medical/functions/fnc_isBeingDragged.sqf b/addons/medical/functions/fnc_isBeingDragged.sqf index 929b48ccb7..b0297c0049 100644 --- a/addons/medical/functions/fnc_isBeingDragged.sqf +++ b/addons/medical/functions/fnc_isBeingDragged.sqf @@ -17,9 +17,7 @@ params ["_target"]; -private "_owner"; - -_owner = _target getVariable [QEGVAR(common,owner), objNull]; +private _owner = _target getVariable [QEGVAR(common,owner), objNull]; if (isNull _owner) exitWith {false}; diff --git a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf index 92814ed052..5bdaccff93 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf @@ -17,9 +17,8 @@ params ["_logic"]; if (!isNull _logic) then { - private ["_list", "_setting"]; - _list = _logic getVariable ["EnableList", ""]; - _setting = _logic getVariable ["role", 0]; + private _list = _logic getVariable ["EnableList", ""]; + private _setting = _logic getVariable ["role", 0]; [_list, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); [synchronizedObjects _logic, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index 2bc6d3a332..60a46f8420 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -17,9 +17,8 @@ params ["_logic"]; if (!isNull _logic) then { - private ["_list", "_setting"]; - _list = _logic getVariable ["EnableList", ""]; - _setting = _logic getVariable ["enabled", 0]; + private _list = _logic getVariable ["EnableList", ""]; + private _setting = _logic getVariable ["enabled", 0]; [_list, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); [synchronizedObjects _logic, QGVAR(medicClass), _setting, true, true] call EFUNC(common,assignObjectsInList); diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index f41dda8591..69bda192dd 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -14,7 +14,6 @@ #include "script_component.hpp" -private "_timeInCardiacArrest"; params ["_unit"]; if (_unit getVariable [QGVAR(inCardiacArrest),false]) exitWith {}; @@ -24,7 +23,7 @@ _unit setVariable [QGVAR(heartRate), 0]; ["ace_cardiacArrestEntered", [_unit]] call CBA_fnc_localEvent; [_unit, true] call FUNC(setUnconscious); -_timeInCardiacArrest = 120 + round(random(600)); +private _timeInCardiacArrest = 120 + round(random(600)); [{ params ["_args", "_idPFH"]; diff --git a/addons/medical/functions/fnc_setStructuralDamage.sqf b/addons/medical/functions/fnc_setStructuralDamage.sqf index b4dc74eac1..ba30b08153 100644 --- a/addons/medical/functions/fnc_setStructuralDamage.sqf +++ b/addons/medical/functions/fnc_setStructuralDamage.sqf @@ -15,8 +15,7 @@ params ["_unit", "_damage"]; if (!local _unit) exitWith {}; -private "_allHitPoints"; -_allHitPoints = getAllHitPointsDamage _unit select 2; +private _allHitPoints = getAllHitPointsDamage _unit select 2; _unit setDamage _damage; diff --git a/addons/medical/functions/fnc_showBloodEffect.sqf b/addons/medical/functions/fnc_showBloodEffect.sqf index 7659064aaa..8ed77714cb 100644 --- a/addons/medical/functions/fnc_showBloodEffect.sqf +++ b/addons/medical/functions/fnc_showBloodEffect.sqf @@ -32,8 +32,7 @@ if (count _fxBloodControls != 3) then { _bloodCtrl3 ctrlSetText "A3\Ui_f\data\igui\rsctitles\HealthTextures\blood_upper_ca.paa"; // positions are from config - private "_ctrlPosition"; - _ctrlPosition = [ + private _ctrlPosition = [ ((0 * safezoneW) + safezoneX) + ((safezoneW - (2.125 * safezoneW * 3/4)) / 2), (-0.0625 * safezoneH) + safezoneY, 2.125 * safezoneW * 3/4, diff --git a/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf b/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf index aadcb40d45..0a1e48288f 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf @@ -16,12 +16,10 @@ */ #include "script_component.hpp" - -private "_bandagedWounds"; params ["_args", "_elapsedTime", "_totalTime"]; _args params ["_caller", "_target"]; -_bandagedWounds = _target getVariable [QGVAR(bandagedWounds), []]; +private _bandagedWounds = _target getVariable [QGVAR(bandagedWounds), []]; //In case two people stitch up one patient and the last wound has already been closed we can stop already if (count _bandagedWounds == 0) exitWith { false }; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index 456c415362..7b16fad650 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -16,12 +16,11 @@ #include "script_component.hpp" -private "_removeItem"; params ["_caller", "_target", "_selectionName", "_className", "_items"]; -if (count _items == 0) exitWith {false}; +if (_items isEqualTo []) exitWith {false}; -_removeItem = _items select 0; +_items params ["_removeItem"]; if (local _target) then { [QGVAR(treatmentIVLocal), [_target, _className]] call CBA_fnc_localEvent; } else { diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf index a956cdde69..130f76af2f 100644 --- a/addons/medical_menu/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -18,7 +18,7 @@ params ["_target", "_display"]; -private["_allInjuryTexts", "_bandagedwounds", "_damaged", "_genericMessages", "_logs", "_openWounds", "_part", "_partText", "_pointDamage", "_selectionBloodLoss", "_selectionN", "_severity", "_totalIvVolume", "_triageStatus"]; +private ["_allInjuryTexts", "_bandagedwounds", "_damaged", "_genericMessages", "_logs", "_openWounds", "_part", "_partText", "_pointDamage", "_selectionBloodLoss", "_selectionN", "_severity", "_totalIvVolume", "_triageStatus"]; if (isNil "_display" || {isNull _display}) exitWith {ERROR("No display");}; @@ -47,8 +47,7 @@ if (_target getVariable [QEGVAR(medical,hasPain), false]) then { _totalIvVolume = 0; { - private "_value"; - _value = _target getVariable _x; + private _value = _target getVariable _x; if (!isNil "_value") then { _totalIvVolume = _totalIvVolume + (_target getVariable [_x, 0]); }; diff --git a/addons/microdagr/functions/fnc_canShow.sqf b/addons/microdagr/functions/fnc_canShow.sqf index d339f80794..cb652b9214 100644 --- a/addons/microdagr/functions/fnc_canShow.sqf +++ b/addons/microdagr/functions/fnc_canShow.sqf @@ -16,9 +16,7 @@ #include "script_component.hpp" params ["_showType"]; -private ["_returnValue"]; - -_returnValue = false; +private _returnValue = false; _returnValue = switch (_showType) do { case (DISPLAY_MODE_CLOSED): { true }; //Can always close diff --git a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf index f99ec78354..ded268299c 100644 --- a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf @@ -17,11 +17,8 @@ */ #include "script_component.hpp" -private "_waypoints"; params ["_waypointName","_waypointPosASL"]; - - -_waypoints = ACE_player getVariable [QGVAR(waypoints), []]; +private _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 d3681466b4..b2e4f13d06 100644 --- a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf @@ -16,10 +16,9 @@ */ #include "script_component.hpp" -private "_waypoints"; params ["_wpIndex"]; -_waypoints = ACE_player getVariable [QGVAR(waypoints), []]; +private _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 2226011215..02e111929d 100644 --- a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf +++ b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf @@ -20,12 +20,10 @@ params ["_theMap", "_mouseButton", "_xPos", "_yPos"]; -private ["_worldPos"]; - //Only handle LMB if (_mouseButton != 0) exitWith {}; -_worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos]; +private _worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos]; _worldPos pushBack (getTerrainHeightASL _worldPos); GVAR(newWaypointPosition) = _worldPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index d3f095ee95..1fec6b1ee0 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -7,9 +7,9 @@ #define STAGE_TERMINAL 4 EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; -private["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; +private ["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; +private ["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; +private ["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; @@ -24,7 +24,7 @@ if( (count _state) < 1) then { _shooterPos = getPosASL _shooter; _projectilePos = getPosASL _projectile; -_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; +_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; _distanceToShooter = _projectilePos vectorDistance _shooterPos; _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; @@ -36,10 +36,10 @@ _returnTargetPos = _seekerTargetPos; switch( (_state select 0) ) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); - if(_distanceToShooter < 10) then { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + if(_distanceToShooter < 10) then { + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 2]; } else { - _state set[0, STAGE_CLIMB]; + _state set [0, STAGE_CLIMB]; }; }; case STAGE_CLIMB: { @@ -47,9 +47,9 @@ switch( (_state select 0) ) do { _cruisAlt = 60 * (_distanceShooterToTarget/2000); if( ((ASLToATL _projectilePos) select 2) - ((ASLToATL _seekerTargetPos) select 2) >= _cruisAlt) then { - _state set[0, STAGE_TERMINAL]; + _state set [0, STAGE_TERMINAL]; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 1.5]; }; }; case STAGE_TERMINAL: { @@ -59,8 +59,8 @@ switch( (_state select 0) ) do { }; #ifdef DEBUG_MODE_FULL -drawLine3D [(ASLtoATL _returnTargetPos), (ASLtoATL _seekerTargetPos), [0,1,0,1]]; +drawLine3D [(ASLtoATL _returnTargetPos), (ASLtoATL _seekerTargetPos), [0, 1, 0, 1]]; #endif TRACE_1("Adjusted target position", _returnTargetPos); -_returnTargetPos; \ No newline at end of file +_returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index f26bcc58b0..0549e174bb 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -7,9 +7,9 @@ #define STAGE_TERMINAL 4 EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; -private["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; +private ["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; +private [_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; +private [cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; @@ -25,7 +25,7 @@ if( (count _state) < 1) then { _shooterPos = getPosASL _shooter; _projectilePos = getPosASL _projectile; -_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; +_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; _distanceToShooter = _projectilePos vectorDistance _shooterPos; _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; @@ -37,8 +37,8 @@ _returnTargetPos = _seekerTargetPos; switch( (_state select 0) ) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); - if(_distanceToShooter < 10) then { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + if(_distanceToShooter < 10) then { + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 2]; } else { _state set[0, STAGE_CLIMB]; }; @@ -50,35 +50,35 @@ switch( (_state select 0) ) do { _cruisAlt = 140 * (_distanceShooterToTarget/1250); TRACE_1("_cruisAlt", _cruisAlt); }; - if( ((ASLToATL _projectilePos) select 2) - ((ASLToATL _seekerTargetPos) select 2) >= _cruisAlt) then { + if(((ASLToATL _projectilePos) select 2) - ((ASLToATL _seekerTargetPos) select 2) >= _cruisAlt) then { if(_cruisAlt < 140) then { _state set[0, STAGE_TERMINAL]; } else { _state set[0, STAGE_COAST]; }; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; + _returnTargetPos = _seekerTargetPos vectorAdd [0, 0, _distanceToTarget * 1.5]; }; }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); TRACE_1("", ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) ); - if(_distanceToTarget < ( ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) ) * 1.5) then { + if(_distanceToTarget < (((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2)) * 1.5) then { _state set[0, STAGE_TERMINAL]; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2)]; + _returnTargetPos = _seekerTargetPos vectorAdd [0, 0, (_projectilePos select 2)]; }; }; case STAGE_TERMINAL: { TRACE_1("STAGE_TERMINAL",""); - //_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.02]; + //_returnTargetPos = _seekerTargetPos vectorAdd [0, 0, _distanceToTarget * 0.02]; _returnTargetPos = _seekerTargetPos; }; }; #ifdef DEBUG_MODE_FULL -drawLine3D [(ASLtoATL _returnTargetPos), (ASLtoATL _seekerTargetPos), [0,1,0,1]]; +drawLine3D [(ASLtoATL _returnTargetPos), (ASLtoATL _seekerTargetPos), [0, 1, 0, 1]]; #endif TRACE_1("Adjusted target position", _returnTargetPos); -_returnTargetPos; \ No newline at end of file +_returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index 4369f37ef4..f85643a8e2 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -2,8 +2,8 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_shooterPos"]; +private ["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; +private ["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_shooterPos"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; diff --git a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf index 93cf40adfe..9415f347b6 100644 --- a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf +++ b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -private["_seeker", "_targetPos", "_seekerMaxAngle", "_sensorPos", "_testPointVector", "_testDotProduct"]; +private ["_seeker", "_targetPos", "_seekerMaxAngle", "_sensorPos", "_testPointVector", "_testDotProduct"]; _seeker = _this select 0; _targetPos = _this select 1; diff --git a/addons/missileguidance/functions/fnc_doAttackProfile.sqf b/addons/missileguidance/functions/fnc_doAttackProfile.sqf index 436cf275fe..1c589838f5 100644 --- a/addons/missileguidance/functions/fnc_doAttackProfile.sqf +++ b/addons/missileguidance/functions/fnc_doAttackProfile.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_testName", "_attackProfilePos", "_attackProfile", "_attackProfileName", "_attackProfilesCfg", "_i", "_launchParams", "_testame", "_testProfile"]; +private ["_testName", "_attackProfilePos", "_attackProfile", "_attackProfileName", "_attackProfilesCfg", "_i", "_launchParams", "_testame", "_testProfile"]; _launchParams = ((_this select 1) select 1); _attackProfileName = _launchParams select 3; diff --git a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf index fe73cd5118..4eaefb6656 100644 --- a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf +++ b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_seekerProfilePos", "_i", "_launchParams", "_seekerType", "_seekerTypeName", "_seekerTypesCfg", "_testName", "_testProfile"]; +private ["_seekerProfilePos", "_i", "_launchParams", "_seekerType", "_seekerTypeName", "_seekerTypesCfg", "_testName", "_testProfile"]; _launchParams = ((_this select 1) select 1); _seekerTypeName = _launchParams select 2; @@ -12,7 +12,7 @@ TRACE_1("Seeker type", _seekerTypeName); _seekerTypesCfg = ( configFile >> QGVAR(SeekerTypes) ); _seekerType = nil; -for [{_i=0}, {_i< (count _seekerTypesCfg) }, {_i=_i+1}] do { +for [{_i = 0}, {_i< (count _seekerTypesCfg) }, {_i=_i + 1}] do { _testProfile = _seekerTypesCfg select _i; _testName = configName _testProfile; TRACE_3("", _testName, _testProfile, _seekerTypesCfg); @@ -22,7 +22,7 @@ for [{_i=0}, {_i< (count _seekerTypesCfg) }, {_i=_i+1}] do { }; }; -_seekerProfilePos = [0,0,0]; +_seekerProfilePos = [0, 0, 0]; if(!isNil "_seekerType") then { _seekerProfilePos = _this call (missionNamespace getVariable (getText (_seekerType >> "functionName"))); }; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 36c11d58af..a007d333f1 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -3,11 +3,11 @@ #define TIMESTEP_FACTOR 0.01 -private["_launchParams", "_targetLaunchParams", "_flightParams", "_seekerParams", "_stateParams"]; -private["_lastRunTime", "_runtimeDelta", "_adjustTime", "_args", "_seekerTargetPos", "_projectilePos"]; -private["_profileAdjustedTargetPos", "_incDeflection", "_minDeflection", "_maxDeflection"]; -private["_targetVector", "_adjustVector", "_finalAdjustVector", "_changeVector", "_pitch", "_yaw", "_roll"]; -private["_PS", "_distanceToTarget", "_targetRelativeVector", "_vectorTo"]; +private ["_launchParams", "_targetLaunchParams", "_flightParams", "_seekerParams", "_stateParams"]; +private ["_lastRunTime", "_runtimeDelta", "_adjustTime", "_args", "_seekerTargetPos", "_projectilePos"]; +private ["_profileAdjustedTargetPos", "_incDeflection", "_minDeflection", "_maxDeflection"]; +private ["_targetVector", "_adjustVector", "_finalAdjustVector", "_changeVector", "_pitch", "_yaw", "_roll"]; +private ["_PS", "_distanceToTarget", "_targetRelativeVector", "_vectorTo"]; _args = _this select 0; EXPLODE_7_PVT((_args select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 2a263721de..2269810b94 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -13,8 +13,8 @@ if( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith { false }; // Bail on not missile if(! (_ammo isKindOf "MissileBase") ) exitWith { false }; -private["_config", "_configs", "_enabled", "_target", "_seekerType", "_attackProfile"]; -private["_args", "_canUseLock", "_guidingUnit", "_launchPos", "_lockMode", "_targetPos", "_vanillaTarget"]; +private ["_config", "_configs", "_enabled", "_target", "_seekerType", "_attackProfile"]; +private ["_args", "_canUseLock", "_guidingUnit", "_launchPos", "_lockMode", "_targetPos", "_vanillaTarget"]; //Verify ammo has explicity added guidance config (ignore inheritances) _configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), QUOTE(configName _x == QUOTE(QUOTE(ADDON))), false]; diff --git a/addons/missileguidance/functions/fnc_rotateVectLine.sqf b/addons/missileguidance/functions/fnc_rotateVectLine.sqf index b42c8d103d..9adb283cae 100644 --- a/addons/missileguidance/functions/fnc_rotateVectLine.sqf +++ b/addons/missileguidance/functions/fnc_rotateVectLine.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" -private["_d", "_map", "_p", "_theta", "_u"]; +private ["_d", "_map", "_p", "_theta", "_u"]; _map = _this select 0; _theta = _this select 1; diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index c9b44b8a82..b491110ac6 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -2,8 +2,8 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targets", "_foundTargetPos", "_launchParams", "_seekerParams", "_targetLaunchParams"]; -private["_angleFov", "_angleOkay", "_losOkay", "_seekerTargetPos", "_sensorPos", "_target"]; +private ["_targets", "_foundTargetPos", "_launchParams", "_seekerParams", "_targetLaunchParams"]; +private ["_angleFov", "_angleOkay", "_losOkay", "_seekerTargetPos", "_sensorPos", "_target"]; _seekerTargetPos = _this select 0; @@ -36,7 +36,7 @@ if(!_angleOkay || !_losOkay) then { _foundTargetPos = _sensorPos vectorAdd ((velocity _projectile) vectorMultiply 5); } else { TRACE_2("", _target, _foundTargetPos); - private["_projectileSpeed", "_distanceToTarget", "_eta", "_adjustDistance"]; + private ["_projectileSpeed", "_distanceToTarget", "_eta", "_adjustDistance"]; // @TODO: Configurable lead for seekers _projectileSpeed = (vectorMagnitude velocity _projectile); _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos; diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index 415e516617..034fc03e45 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_angleFov", "_canSeeTarget", "_foundTargetPos", "_laserResult", "_launchParams", "_seekerParams", "_laserCode", "_laserParams", "_seekerTargetPos", "_sensorPos", "_target"]; +private ["_angleFov", "_canSeeTarget", "_foundTargetPos", "_laserResult", "_launchParams", "_seekerParams", "_laserCode", "_laserParams", "_seekerTargetPos", "_sensorPos", "_target"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; _seekerParams = _launchParams select 3; diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf index 8c8760bc15..5c74927e46 100644 --- a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -45,7 +45,7 @@ if (_lastFireMode != -1) then { }; [{ - private["_chargeText", "_currentChargeMode", "_currentFireMode", "_display", "_elevDeg", "_elevationDiff", "_lookVector", "_notGunnerView", "_realAzimuth", "_realElevation", "_upVectorDir", "_useMils", "_weaponDir"]; + private ["_chargeText", "_currentChargeMode", "_currentFireMode", "_display", "_elevDeg", "_elevationDiff", "_lookVector", "_notGunnerView", "_realAzimuth", "_realElevation", "_upVectorDir", "_useMils", "_weaponDir"]; PARAMS_2(_args,_pfID); EXPLODE_2_PVT(_args,_mortarVeh,_fireModes); diff --git a/addons/mk6mortar/functions/fnc_toggleMils.sqf b/addons/mk6mortar/functions/fnc_toggleMils.sqf index 923a553f43..5c27bf64e4 100644 --- a/addons/mk6mortar/functions/fnc_toggleMils.sqf +++ b/addons/mk6mortar/functions/fnc_toggleMils.sqf @@ -18,7 +18,5 @@ PARAMS_2(_mortarVeh,_unit); -private "_currentSetting"; - -_currentSetting = _mortarVeh getVariable [QGVAR(useMils), true]; +private _currentSetting = _mortarVeh getVariable [QGVAR(useMils), true]; _mortarVeh setVariable [QGVAR(useMils), (!_currentSetting)]; diff --git a/addons/nametags/functions/fnc_doShow.sqf b/addons/nametags/functions/fnc_doShow.sqf index 18c434f4c6..1f689704b9 100644 --- a/addons/nametags/functions/fnc_doShow.sqf +++ b/addons/nametags/functions/fnc_doShow.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" #include "common.hpp"; -private["_roleImages", "_player", "_vehicle", "_type", "_config", "_text", "_data", "_isAir", "_turretUnits", "_turretRoles", "_index", "_roleType", "_unit", "_toShow"]; +private ["_roleImages", "_player", "_vehicle", "_type", "_config", "_text", "_data", "_isAir", "_turretUnits", "_turretRoles", "_index", "_roleType", "_unit", "_toShow"]; _player = ACE_player; _vehicle = vehicle _player; diff --git a/addons/nametags/functions/fnc_getVehicleData.sqf b/addons/nametags/functions/fnc_getVehicleData.sqf index 656cb8dc81..1c916f81aa 100644 --- a/addons/nametags/functions/fnc_getVehicleData.sqf +++ b/addons/nametags/functions/fnc_getVehicleData.sqf @@ -20,33 +20,28 @@ #include "script_component.hpp" #include "common.hpp"; -private ["_type", "_varName", "_data", "_isAir", "_config", "_fnc_addTurret", "_fnc_addTurretUnit"]; - params ["_type"]; -_varName = format ["ACE_CrewInfo_Cache_%1", _type]; -_data = + (uiNamespace getVariable _varName); +private _varName = format ["ACE_CrewInfo_Cache_%1", _type]; +private _data = + (uiNamespace getVariable _varName); if (!isNil "_data") exitWith {_data}; _data = []; -_isAir = _type isKindOf "Air"; +private _isAir = _type isKindOf "Air"; -_fnc_addTurretUnit = { - private ["_config", "_path", "_role", "_simulationEmpty", "_simulationLaserDesignate", "_simulationOther", "_magazine", "_ammo", "_simulation"]; +private _fnc_addTurretUnit = { + params ["_config", "_path"]; + private _role = CARGO; - _config = _this select 0; - _path = _this select 1; - _role = CARGO; - - _simulationEmpty = 0; - _simulationLaserDesignate = 0; - _simulationOther = 0; + private _simulationEmpty = 0; + private _simulationLaserDesignate = 0; + private _simulationOther = 0; { { - _magazine = configFile >> "CfgMagazines" >> _x; - _ammo = configFile >> "CfgAmmo" >> getText (_magazine >> "ammo"); - _simulation = getText (_ammo >> "simulation"); + private _magazine = configFile >> "CfgMagazines" >> _x; + private _ammo = configFile >> "CfgAmmo" >> getText (_magazine >> "ammo"); + private _simulation = getText (_ammo >> "simulation"); if(_simulation=="") then { _simulationEmpty = _simulationEmpty + 1; @@ -78,21 +73,17 @@ _fnc_addTurretUnit = { }; -_fnc_addTurret = { - - private ["_config", "_path", "_count", "_offset", "_index", "_turretPath", "_turretConfig"]; - - _config = _this select 0; - _path = _this select 1; +private _fnc_addTurret = { + params ["_config", "_path"]; _config = _config >> "Turrets"; - _count = count _config; + private _count = count _config; - _offset = 0; + private _offset = 0; for "_index" from 0 to (_count - 1) do { - _turretPath = _path + [_index - _offset]; - _turretConfig = _config select _index; + private _turretPath = _path + [_index - _offset]; + private _turretConfig = _config select _index; if (isClass _turretConfig) then { [_turretConfig, _turretPath] call _fnc_addTurretUnit; [_turretConfig, _turretPath] call _fnc_addTurret; diff --git a/addons/nametags/functions/fnc_setText.sqf b/addons/nametags/functions/fnc_setText.sqf index 842c765de1..9bc084cfd4 100644 --- a/addons/nametags/functions/fnc_setText.sqf +++ b/addons/nametags/functions/fnc_setText.sqf @@ -19,7 +19,7 @@ params ["_text"]; -private["_ctrl"]; +private ["_ctrl"]; disableSerialization; diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf index 9f02323787..04cea0f214 100644 --- a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -19,11 +19,9 @@ params ["_player", "_changeInBrightness"]; TRACE_2("params",_player,_changeInBrightness); -private ["_brightness"]; - if (!hasInterface) exitWith {}; -_brightness = _player getVariable [QGVAR(NVGBrightness), 0]; +private _brightness = _player getVariable [QGVAR(NVGBrightness), 0]; _brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 0.5) max -0.5; diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf index c994d2cdb9..f1216fb15d 100644 --- a/addons/optics/functions/fnc_handleFired.sqf +++ b/addons/optics/functions/fnc_handleFired.sqf @@ -23,8 +23,7 @@ private _display = uiNamespace getVariable [QGVAR(RscWeaponInfo2D), displayNull] if (isNull _display) exitWith {}; // Reduce the reticle movement as the player drops into lower, supported stances. -private "_recoilCoef"; -_recoilCoef = switch (true) do { +private _recoilCoef = switch (true) do { case (isWeaponDeployed _unit): {0.1}; case (isWeaponRested _unit): {0.4}; default {1}; @@ -44,13 +43,12 @@ _scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN // Create and commit recoil effect private ["_sizeX", "_sizeY"]; -_sizeX = (0.75+_recoilScope)/(getResolution select 5); +_sizeX = (0.75 + _recoilScope)/(getResolution select 5); _sizeY = _sizeX*(4/3); -private "_positionReticle"; -_positionReticle = [ - safezoneX+0.5*safezoneW-0.5*(_sizeX+_reticleShiftX), - safezoneY+0.5*safezoneH-0.5*(_sizeY+_reticleShiftY), +private _positionReticle = [ + safezoneX + 0.5 * safezoneW - 0.5*(_sizeX + _reticleShiftX), + safezoneY + 0.5 * safezoneH - 0.5*(_sizeY + _reticleShiftY), _sizeX, _sizeY ]; @@ -58,12 +56,11 @@ _positionReticle = [ (_display displayCtrl 1713001) ctrlSetPosition _positionReticle; (_display displayCtrl 1713002) ctrlSetPosition _positionReticle; -private "_positionBody"; -_positionBody = [ - safezoneX+0.5*safezoneW-0.5*(2*_sizeX+_scopeShiftX), - safezoneY+0.5*safezoneH-0.5*(2*_sizeY+_scopeShiftY), - 2*_sizeX, - 2*_sizeY +private _positionBody = [ + safezoneX + 0.5 * safezoneW - 0.5*(2 * _sizeX + _scopeShiftX), + safezoneY + 0.5 * safezoneH - 0.5*(2 * _sizeY + _scopeShiftY), + 2 * _sizeX, + 2 * _sizeY ]; (_display displayCtrl 1713005) ctrlSetPosition _positionBody; @@ -79,8 +76,8 @@ _sizeX = 0.75/(getResolution select 5); _sizeY = _sizeX*(4/3); _positionReticle = [ - safezoneX+0.5*safezoneW-0.5*_sizeX, - safezoneY+0.5*safezoneH-0.5*_sizeY, + safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, + safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, _sizeX, _sizeY ]; @@ -89,10 +86,10 @@ _positionReticle = [ (_display displayCtrl 1713002) ctrlSetPosition _positionReticle; _positionBody = [ - safezoneX+0.5*safezoneW-0.5*2*_sizeX, - safezoneY+0.5*safezoneH-0.5*2*_sizeY, - 2*_sizeX, - 2*_sizeY + safezoneX + 0.5 * safezoneW - 0.5 * 2 * _sizeX, + safezoneY + 0.5 * safezoneH - 0.5 * 2 * _sizeY, + 2 * _sizeX, + 2 * _sizeY ]; (_display displayCtrl 1713005) ctrlSetPosition _positionBody; diff --git a/addons/optics/functions/fnc_onDrawScope.sqf b/addons/optics/functions/fnc_onDrawScope.sqf index d977149c95..fd899b5a02 100644 --- a/addons/optics/functions/fnc_onDrawScope.sqf +++ b/addons/optics/functions/fnc_onDrawScope.sqf @@ -3,20 +3,16 @@ disableSerialization; -private ["_display", "_control"]; +params ["_display"]; -_display = _this select 0; - -_control = _display displayCtrl 1713154; +private _control = _display displayCtrl 1713154; if (!ctrlShown (_display displayCtrl 154)) exitWith { _control ctrlShow false; }; -private ["_sizeX", "_sizeY"]; - -_sizeX = (call EFUNC(common,getZoom))/4; -_sizeY = _sizeX*safezoneW/safezoneH; +private _sizeX = (call EFUNC(common,getZoom))/4; +private _sizeY = _sizeX*safezoneW/safezoneH; _control ctrlSetPosition [ safezoneX+0.5*safezoneW-0.5*_sizeX, diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf index 1a93f77c0b..e8b26dca65 100644 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ b/addons/optics/functions/fnc_onDrawScope2D.sqf @@ -18,7 +18,7 @@ disableSerialization; -private _display = _this select 0; +params ["_display"]; // @todo, all weapon types private _optic = (primaryWeaponItems ACE_player) select 2; diff --git a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf index 5b302a510d..633a9aa162 100644 --- a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf +++ b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf @@ -13,8 +13,7 @@ #include "script_component.hpp" -private ["_logic"]; -_logic = _this select 0; +params ["_logic"]; if (isMultiplayer) exitWith {}; diff --git a/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf index 123a156731..2824c2e2fa 100644 --- a/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf @@ -16,12 +16,10 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlComboBox"]; - disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; +private _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; -_ctrlComboBox = (_settingsMenu displayCtrl 14); +private _ctrlComboBox = (_settingsMenu displayCtrl 14); GVAR(currentCategorySelection) = _ctrlComboBox lbValue (lbCurSel _ctrlComboBox); [true] call FUNC(settingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index b122d0da0e..6486a5e39b 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -16,12 +16,10 @@ #include "script_component.hpp" -private ["_settingIndex", "_rightDropDownIndex"]; - -_rightDropDownIndex = lbCurSel 400; //Index of right drop down +private _rightDropDownIndex = lbCurSel 400; //Index of right drop down if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;}; -_settingIndex = -1; +private _settingIndex = -1; if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index 43c17cd619..6a9e5c9fb8 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_setting", "_menu", "_settingsMenu"]; +private ["_setting", "_settingsMenu"]; if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitWith {closeDialog 145246;}; @@ -25,13 +25,7 @@ GVAR(serverSideOptions) = []; GVAR(serverSideColors) = []; GVAR(serverSideValues) = []; { - _name = _x select 0; - _typeName = _x select 1; - _isClientSetable = _x select 2; - _localizedName = _x select 3; - _localizedDescription = _x select 4; - _possibleValues = _x select 5; - _defaultValue = _x select 6; + _x params ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue"]; // Exclude client side options if they are not included for the export if (!(_isClientSetable) || GVAR(ClientSettingsExportIncluded)) then { @@ -57,7 +51,7 @@ GVAR(serverSideValues) = []; [{ [MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged) }, []] call CBA_fnc_execNextFrame; disableSerialization; -_menu = uiNamespace getVariable "ACE_serverSettingsMenu"; +private _menu = uiNamespace getVariable "ACE_serverSettingsMenu"; (_menu displayCtrl 1003) ctrlEnable false; if (GVAR(ClientSettingsExportIncluded)) then { diff --git a/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf b/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf index 1f6ec765b3..29c08275ef 100644 --- a/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf +++ b/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf @@ -11,7 +11,7 @@ * Public: No */ #include "script_component.hpp" -params["_unit"]; +params ["_unit"]; //Get the classname of the spare barrel for the weapon private _weaponBarrelClass = getText (configFile >> 'CfgWeapons' >> currentWeapon _player >> QGVAR(barrelClassname)); diff --git a/addons/overheating/functions/fnc_canSwapBarrel.sqf b/addons/overheating/functions/fnc_canSwapBarrel.sqf index f68e4ccac8..e183490439 100644 --- a/addons/overheating/functions/fnc_canSwapBarrel.sqf +++ b/addons/overheating/functions/fnc_canSwapBarrel.sqf @@ -11,7 +11,7 @@ * Public: No */ #include "script_component.hpp" -params["_unit","_weapon"]; +params ["_unit","_weapon"]; //Check if weapon can have its barrel swapped. If not exit out of function if( !GVAR(enabled) && (getNumber (configFile >> 'CfgWeapons' >> _weapon >> QGVAR(allowSwapBarrel))) != 1) exitWith{false}; diff --git a/addons/overheating/functions/fnc_firedEH.sqf b/addons/overheating/functions/fnc_firedEH.sqf index e392190bb0..b7409355a2 100644 --- a/addons/overheating/functions/fnc_firedEH.sqf +++ b/addons/overheating/functions/fnc_firedEH.sqf @@ -77,7 +77,7 @@ if (GVAR(showParticleEffects) && {(CBA_missionTime > ((_unit getVariable [QGVAR( if (_intensity > 0) then { drop [ "\A3\data_f\ParticleEffects\Universal\Refract", "", "Billboard", 10, 2, _position, _direction, 0, 1.2, 1.0, - 0.1, [0.10,0.25], [[0.6,0.6,0.6,0.3*_intensity],[0.2,0.2,0.2,0.05*_intensity]], [0,1], 0.1, 0.05, "", "", ""]; + 0.1, [0.10,0.25], [[0.6,0.6,0.6,0.3 * _intensity],[0.2,0.2,0.2,0.05 * _intensity]], [0,1], 0.1, 0.05, "", "", ""]; }; // Smoke SFX, beginning at temp 150°C private _intensity = linearConversion [0.15, 1, _scaledTemperature, 0, 1, true]; @@ -85,7 +85,7 @@ if (GVAR(showParticleEffects) && {(CBA_missionTime > ((_unit getVariable [QGVAR( if (_intensity > 0) then { drop [ ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 1, 16], "", "Billboard", 10, 1.2, _position, - [0,0,0.15], 100 + random 80, 1.275, 1, 0.025, [0.15,0.43], [[0.6,0.6,0.6,0.5*_intensity],[0.2,0.2,0.2,0.15*_intensity]], + [0,0,0.15], 100 + random 80, 1.275, 1, 0.025, [0.15,0.43], [[0.6,0.6,0.6,0.5 * _intensity],[0.2,0.2,0.2,0.15 * _intensity]], [0,1], 1, 0.04, "", "", ""]; }; }; diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index ad7234b08c..a9a37a0560 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -25,7 +25,7 @@ private _var = if (isNil _varName) then { } else { missionNameSpace getVariable _varName; }; -_var params["_backblastAngle","_backblastRange","_backblastDamage"]; +_var params ["_backblastAngle","_backblastRange","_backblastDamage"]; TRACE_3("cache",_backblastAngle,_backblastRange,_backblastDamage); if (_backblastDamage <= 0) exitWith {}; diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index a846d723a1..0c02526928 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -25,7 +25,7 @@ private _var = if (isNil _varName) then { } else { missionNameSpace getVariable _varName; }; -_var params["_dangerZoneAngle","_dangerZoneRange","_dangerZoneDamage"]; +_var params ["_dangerZoneAngle","_dangerZoneRange","_dangerZoneDamage"]; TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); if (_dangerZoneDamage <= 0) exitWith {}; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index 5852cf3bfd..75286a968b 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -30,7 +30,7 @@ private _var = if (isNil _varName) then { } else { missionNameSpace getVariable _varName; }; -_var params["_overpressureAngle","_overpressureRange","_overpressureDamage"]; +_var params ["_overpressureAngle","_overpressureRange","_overpressureDamage"]; TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); { diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index dfe22b4bc0..94137ed67c 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -14,6 +14,5 @@ * Public: No */ #include "script_component.hpp" -private["_unit"]; -_unit = _this select 0; +params ["_unit"]; (vehicle _unit isKindOf 'ParachuteBase' && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getVariable [QGVAR(hasReserve),false])) \ No newline at end of file diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index e594e28223..f7aa86991b 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -14,9 +14,8 @@ * Public: No */ #include "script_component.hpp" -private["_unit","_vehicle"]; -_unit = _this select 0; -_vehicle = vehicle _unit; +params ["_unit"]; +private _vehicle = vehicle _unit; _unit action ["GetOut", _vehicle]; deleteVehicle _vehicle; _unit setVariable [QGVAR(chuteIsCut), true, true]; diff --git a/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf index 9b076256dd..b27849a0c8 100644 --- a/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf +++ b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_dialog", "_type"]; - -_dialog = _this select 0; -_type = _this select 1; +params ["_dialog", "_type"]; // don't do anything in noob mode if (cadetMode) exitWith {}; @@ -29,8 +26,7 @@ switch (_type) do { case ("Soldier"): { { - private "_control"; - _control = (_dialog displayCtrl _x); + private _control = (_dialog displayCtrl _x); // these reset ctrlShow every frame by the engine. Set height/width to 0 as work around. _control ctrlSetPosition [0,0,0,0]; diff --git a/addons/parachute/functions/fnc_onEachFrame.sqf b/addons/parachute/functions/fnc_onEachFrame.sqf index 94d5a99748..0c6809b648 100644 --- a/addons/parachute/functions/fnc_onEachFrame.sqf +++ b/addons/parachute/functions/fnc_onEachFrame.sqf @@ -14,8 +14,7 @@ * Public: No */ #include "script_component.hpp" -private "_player"; -_player = ACE_player; +private _player = ACE_player; if (!GVAR(PFH)) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);}; if (isNull _player) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;}; if !((vehicle _player) isKindOf "ParachuteBase") exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;}; diff --git a/addons/rearm/XEH_respawn.sqf b/addons/rearm/XEH_respawn.sqf index 7f0d175d1c..33ac042e7c 100644 --- a/addons/rearm/XEH_respawn.sqf +++ b/addons/rearm/XEH_respawn.sqf @@ -1,14 +1,11 @@ #include "script_component.hpp" -private ["_unit"]; - -_unit = _this select 0; - +params ["_unit"]; if !(local _unit) exitWith {}; _unit setVariable [QGVAR(selectedWeaponOnRearm), nil]; _unit setVariable [QGVAR(carriedMagazine), nil]; -_dummy = _unit getVariable [QGVAR(dummy), objNull]; +private _dummy = _unit getVariable [QGVAR(dummy), objNull]; if !(isNull _dummy) then { detach _dummy; deleteVehicle _dummy; diff --git a/addons/rearm/functions/fnc_getMaxMagazines.sqf b/addons/rearm/functions/fnc_getMaxMagazines.sqf index b6211333f0..4b92431ed9 100644 --- a/addons/rearm/functions/fnc_getMaxMagazines.sqf +++ b/addons/rearm/functions/fnc_getMaxMagazines.sqf @@ -17,10 +17,9 @@ */ #include "script_component.hpp" -private ["_count", "_cfg"]; params [["_target", objNull, [objNull]], ["_turretPath", [], [[]]], ["_magazineClass", "", [""]]]; if (isNull _target) exitWith {0}; -_count = {_x == _magazineClass} count ([_target, _turretPath] call FUNC(getConfigMagazines)); +private _count = {_x == _magazineClass} count ([_target, _turretPath] call FUNC(getConfigMagazines)); _count diff --git a/addons/rearm/functions/fnc_grabAmmo.sqf b/addons/rearm/functions/fnc_grabAmmo.sqf index 161627da28..9573ac85a5 100644 --- a/addons/rearm/functions/fnc_grabAmmo.sqf +++ b/addons/rearm/functions/fnc_grabAmmo.sqf @@ -25,12 +25,11 @@ REARM_HOLSTER_WEAPON 5, [_dummy, _unit], { - private ["_actionID"]; params ["_args"]; _args params ["_dummy", "_unit"]; [_dummy, _unit] call FUNC(pickUpAmmo); - _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; if (_actionID != -1) then { _unit removeAction _actionID; }; diff --git a/addons/rearm/functions/fnc_pickUpAmmo.sqf b/addons/rearm/functions/fnc_pickUpAmmo.sqf index 1368b4e959..653c131586 100644 --- a/addons/rearm/functions/fnc_pickUpAmmo.sqf +++ b/addons/rearm/functions/fnc_pickUpAmmo.sqf @@ -16,7 +16,6 @@ */ #include "script_component.hpp" -private ["_magazineClass"]; params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; _dummy = _unit getVariable [QGVAR(dummy), objNull]; diff --git a/addons/rearm/functions/fnc_storeAmmo.sqf b/addons/rearm/functions/fnc_storeAmmo.sqf index 262affb1ef..b94616652e 100644 --- a/addons/rearm/functions/fnc_storeAmmo.sqf +++ b/addons/rearm/functions/fnc_storeAmmo.sqf @@ -16,10 +16,9 @@ */ #include "script_component.hpp" -private "_dummy"; params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; -_dummy = _unit getVariable [QGVAR(dummy), objNull]; +private _dummy = _unit getVariable [QGVAR(dummy), objNull]; if (isNull _dummy) exitwith {}; [ diff --git a/addons/refuel/XEH_respawn.sqf b/addons/refuel/XEH_respawn.sqf index 87b8db3514..085361e7dc 100644 --- a/addons/refuel/XEH_respawn.sqf +++ b/addons/refuel/XEH_respawn.sqf @@ -1,8 +1,6 @@ #include "script_component.hpp" -private ["_unit"]; - -_unit = _this select 0; +params ["_unit"]; if !(local _unit) exitWith {}; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 9739adedfe..8359850a3e 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -20,7 +20,7 @@ if (!hasInterface) exitWith {}; params ["_vehicle"]; TRACE_2("params", _vehicle,typeOf _vehicle); -private["_action", "_childHitPoint", "_condition", "_groupsConfig", "_hitPoint", "_hitPointsAddedAmount", "_hitPointsAddedNames", "_hitPointsAddedStrings", "_icon", "_initializedClasses", "_name", "_position", "_positionsConfig", "_processedHitPoints", "_selection", "_statement", "_target", "_type"]; +private ["_action", "_childHitPoint", "_condition", "_groupsConfig", "_hitPoint", "_hitPointsAddedAmount", "_hitPointsAddedNames", "_hitPointsAddedStrings", "_icon", "_initializedClasses", "_name", "_position", "_positionsConfig", "_processedHitPoints", "_selection", "_statement", "_target", "_type"]; _type = typeOf _vehicle; diff --git a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf index 2ed50c5d0e..93f4883063 100644 --- a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf +++ b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf @@ -19,11 +19,10 @@ params ["_vehicle"]; TRACE_1("params",_vehicle); -private["_bestDist", "_bestIndex", "_wheelBone", "_wheelBoneNameResized", "_wheelCenter", "_wheelCenterPos", "_wheelHitPoint", "_wheelHitPointSelection", "_wheelHitPointSelections", "_wheelHitPoints", "_wheelName", "_xDist", "_xPos"]; +private ["_bestDist", "_bestIndex", "_wheelBone", "_wheelBoneNameResized", "_wheelCenter", "_wheelCenterPos", "_wheelHitPoint", "_wheelHitPointSelection", "_wheelHitPointSelections", "_wheelHitPoints", "_wheelName", "_xDist", "_xPos"]; // get the vehicles wheel config -private "_wheels"; -_wheels = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Wheels"; +private _wheels = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Wheels"; // exit with nothing if the vehicle has no wheels class if !(isClass _wheels) exitWith {TRACE_1("No Wheels",_wheels); [[],[]]}; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index 5577057241..d4f5412e6f 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -21,7 +21,7 @@ params ["_caller", "_target", "_hitPoint", "_className"]; TRACE_4("params",_calller,_target,_hitPoint,_className); -private["_callbackProgress", "_callerAnim", "_calller", "_condition", "_config", "_consumeItems", "_displayText", "_engineerRequired", "_iconDisplayed", "_items", "_repairTime", "_repairTimeConfig", "_return", "_usersOfItems", "_vehicleStateCondition", "_wpn", "_settingName", "_settingItemsArray", "_hitPointClassname"]; +private ["_callbackProgress", "_callerAnim", "_calller", "_condition", "_config", "_consumeItems", "_displayText", "_engineerRequired", "_iconDisplayed", "_items", "_repairTime", "_repairTimeConfig", "_return", "_usersOfItems", "_vehicleStateCondition", "_wpn", "_settingName", "_settingItemsArray", "_hitPointClassname"]; _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); if !(isClass _config) exitWith {false}; // or go for a default? @@ -196,14 +196,13 @@ _repairTime = if (isNumber (_config >> "repairingTime")) then { 0; }; -private ["_processText"]; // Find localized string -_hitPointClassname = if ((typeName _hitPoint) == "STRING") then { +_hitPointClassname = if (_hitPoint isEqualType "") then { _hitPoint } else { ((getAllHitPointsDamage _target) select 0) select _hitPoint }; -_processText = getText (_config >> "displayNameProgress"); +private _processText = getText (_config >> "displayNameProgress"); private _backupText = format [localize LSTRING(RepairingHitPoint), _hitPointClassname]; ([_hitPointClassname, _processText, _backupText] call FUNC(getHitPointString)) params ["_text"]; diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf index 4b68f3ae9d..01a29eb377 100644 --- a/addons/repair/functions/fnc_setHitPointDamage.sqf +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -21,7 +21,7 @@ params ["_vehicle", "_hitPointIndex", "_hitPointDamage"]; TRACE_4("params",_vehicle,typeOf _vehicle,_hitPointIndex,_hitPointDamage); -private["_damageNew", "_damageOld", "_hitPointDamageRepaired", "_hitPointDamageSumOld", "_realHitpointCount", "_selectionName"]; +private ["_damageNew", "_damageOld", "_hitPointDamageRepaired", "_hitPointDamageSumOld", "_realHitpointCount", "_selectionName"]; // can't execute all commands if the vehicle isn't local. exit here. if !(local _vehicle) exitWith {ACE_LOGERROR_1("Vehicle Not Local %1", _vehicle);}; diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf index a1e46c1caf..e8f4f1d110 100644 --- a/addons/respawn/functions/fnc_handleInitPostServer.sqf +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -49,8 +49,7 @@ _unit = leader _groupUnit; _leaderVarName = vehicleVarName _unit; if (_leaderVarName == "") then { - private "_leaderID"; - _leaderID = GETGVAR(NextLeaderID,0); + private _leaderID = GETGVAR(NextLeaderID,0); _leaderVarName = format [QUOTE(ACE_Rallypoint_Leader_%1), _leaderID]; diff --git a/addons/respawn/functions/fnc_handlePlayerChanged.sqf b/addons/respawn/functions/fnc_handlePlayerChanged.sqf index 7d595e6a44..97592db06f 100644 --- a/addons/respawn/functions/fnc_handlePlayerChanged.sqf +++ b/addons/respawn/functions/fnc_handlePlayerChanged.sqf @@ -17,8 +17,7 @@ params ["_newUnit"]; -private "_side"; -_side = side group _newUnit; +private _side = side group _newUnit; ((GETMVAR(ACE_Rallypoint_West, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); ((GETMVAR(ACE_Rallypoint_West_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); diff --git a/addons/respawn/functions/fnc_teleportToRallypoint.sqf b/addons/respawn/functions/fnc_teleportToRallypoint.sqf index 8e766ce0e3..9f2da46640 100644 --- a/addons/respawn/functions/fnc_teleportToRallypoint.sqf +++ b/addons/respawn/functions/fnc_teleportToRallypoint.sqf @@ -19,8 +19,7 @@ params ["_unit", "_side", "_rallypoint"]; -private "_toBase"; -_toBase = _rallypoint find "_Base" != -1; +private _toBase = _rallypoint find "_Base" != -1; _rallypoint = missionNamespace getVariable [_rallypoint, objNull]; diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index c3f46b9f4d..cc11be3806 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -19,14 +19,12 @@ params ["_show"]; disableSerialization; -private "_control"; -_control = (uiNamespace getVariable ["ACE_dlgSoldier", displayNull]) displayCtrl 187; +private _control = (uiNamespace getVariable ["ACE_dlgSoldier", displayNull]) displayCtrl 187; if (isNull _control) exitWith {}; if (_show) then { - private "_config"; - _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; + private _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; _control ctrlCommit 0; diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 0cbe0c5012..af7d5c0a2f 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -21,8 +21,7 @@ params ["_unit"]; [_unit, "forceWalk", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); // create the sandbag -private "_sandBag"; -_sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; +private _sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; GVAR(sandBag) = _sandBag; diff --git a/addons/scopes/functions/fnc_getOptics.sqf b/addons/scopes/functions/fnc_getOptics.sqf index a80c5860e8..64ad73ebdd 100644 --- a/addons/scopes/functions/fnc_getOptics.sqf +++ b/addons/scopes/functions/fnc_getOptics.sqf @@ -17,11 +17,9 @@ */ #include "script_component.hpp" -private "_optics"; - params ["_unit"]; -_optics = ["", "", ""]; +private _optics = ["", "", ""]; if (!(_unit isKindOf "CAManBase")) exitWith {_optics}; diff --git a/addons/scopes/functions/fnc_showZeroing.sqf b/addons/scopes/functions/fnc_showZeroing.sqf index eb47c692bf..530f5cb1d2 100644 --- a/addons/scopes/functions/fnc_showZeroing.sqf +++ b/addons/scopes/functions/fnc_showZeroing.sqf @@ -15,32 +15,30 @@ */ #include "script_component.hpp" -private ["_weaponIndex", "_adjustment", "_layer", "_display", "_zeroing", "_vertical", "_horizontal"]; - disableSerialization; -_weaponIndex = [ACE_player, currentWeapon ACE_player] call EFUNC(common,getWeaponIndex); +private _weaponIndex = [ACE_player, currentWeapon ACE_player] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; -_adjustment = ACE_player getVariable QGVAR(Adjustment); +private _adjustment = ACE_player getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; }; // Display the adjustment knobs -_layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; +private _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; _layer cutRsc [QGVAR(Zeroing), "PLAIN", 0, false]; // Find the display -_display = uiNamespace getVariable [QGVAR(ZeroingDisplay), displayNull]; +private _display = uiNamespace getVariable [QGVAR(ZeroingDisplay), displayNull]; if (isNull _display) exitWith {}; // Update values -_zeroing = _adjustment select _weaponIndex; +private _zeroing = _adjustment select _weaponIndex; _zeroing params ["_elevation", "_windage"]; -_vertical = _display displayCtrl 12; -_horizontal = _display displayCtrl 13; +private _vertical = _display displayCtrl 12; +private _horizontal = _display displayCtrl 13; _vertical ctrlSetText (str _elevation); _horizontal ctrlSetText (str _windage); @@ -52,9 +50,8 @@ if !(isNil QGVAR(fadePFH)) exitWith {}; // Launch a PFH to wait and fade out the knobs GVAR(fadePFH) = [{ if (diag_tickTime >= GVAR(timeToHide)) exitWith { - private "_layer"; - params ["", "_pfhId"]; - _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + private _pfhId = _this select 1; + private _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; _layer cutFadeOut 2; GVAR(fadePFH) = nil; diff --git a/addons/slideshow/functions/fnc_addSlideActions.sqf b/addons/slideshow/functions/fnc_addSlideActions.sqf index a18249a4f8..177627bb7b 100644 --- a/addons/slideshow/functions/fnc_addSlideActions.sqf +++ b/addons/slideshow/functions/fnc_addSlideActions.sqf @@ -19,10 +19,9 @@ */ #include "script_component.hpp" -private "_actions"; params ["_objects", "_images", "_names", "_controller", "_currentSlideshow"]; -_actions = []; +private _actions = []; { _actions pushBack [ diff --git a/addons/slideshow/functions/fnc_autoTransition.sqf b/addons/slideshow/functions/fnc_autoTransition.sqf index d54d629b66..fda7b8ce1b 100644 --- a/addons/slideshow/functions/fnc_autoTransition.sqf +++ b/addons/slideshow/functions/fnc_autoTransition.sqf @@ -18,11 +18,10 @@ */ #include "script_component.hpp" -private "_currentSlide"; params ["_objects", "_images", "_varString", "_duration"]; // Get current slide number of this slideshow -_currentSlide = missionNamespace getVariable [_varString, 0]; +private _currentSlide = missionNamespace getVariable [_varString, 0]; // Increment slide or return to first slide if reached end _currentSlide = (_currentSlide + 1) mod (count _images); diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index 3a69bb1383..e5bb7498e0 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -37,8 +37,7 @@ switch (toLower _mode) do { GVAR(iconHandler) = addMissionEventHandler ["Draw3D",FUNC(handleIcons)]; // Populate the help window - private "_help"; - _help = (_display displayCtrl IDC_HELP) controlsGroupCtrl IDC_HELP_LIST; + private _help = (_display displayCtrl IDC_HELP) controlsGroupCtrl IDC_HELP_LIST; { _i = _help lbAdd (_x select 0); if ((_x select 1) == "") then { @@ -440,12 +439,10 @@ switch (toLower _mode) do { }; // Interrupt events case "escape": { - private "_dlg"; - createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); disableSerialization; - _dlg = finddisplay 49; + private _dlg = finddisplay 49; _dlg displayAddEventHandler ["KeyDown", { _key = _this select 1; !(_key == 1) diff --git a/addons/spectator/functions/fnc_respawnTemplate.sqf b/addons/spectator/functions/fnc_respawnTemplate.sqf index dc83bf7458..1a36170202 100644 --- a/addons/spectator/functions/fnc_respawnTemplate.sqf +++ b/addons/spectator/functions/fnc_respawnTemplate.sqf @@ -19,12 +19,11 @@ #include "script_component.hpp" params [["_unit",objNull,[objNull]], ["_killer",objNull,[objNull]], ["_respawn",0,[0]], ["_respawnDelay",0,[0]]]; -private ["_vision","_pos"]; // Some environment information can be used for the initial camera attributes if (isNull _killer) then {_killer = _unit}; -_vision = [-2,-1] select (sunOrMoon < 1); -_pos = (getPosATL _unit) vectorAdd [0,0,5]; +private _vision = [-2,-1] select (sunOrMoon < 1); +private _pos = (getPosATL _unit) vectorAdd [0,0,5]; // Enter/exit spectator based on the respawn type and whether killed/respawned if (alive _unit) then { diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index e39b6eed22..b6e332e313 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -94,10 +94,10 @@ _fnc_isOk = { true }; -if ( !([ 0.5*TAG_SIZE, 0.5*TAG_SIZE] call _fnc_isOk) || - {!([ 0.5*TAG_SIZE,-0.5*TAG_SIZE] call _fnc_isOk) || - {!([-0.5*TAG_SIZE, 0.5*TAG_SIZE] call _fnc_isOk) || - {!([-0.5*TAG_SIZE,-0.5*TAG_SIZE] call _fnc_isOk)}}}) exitWith { +if ( !([ 0.5 * TAG_SIZE, 0.5 * TAG_SIZE] call _fnc_isOk) || + {!([ 0.5 * TAG_SIZE,-0.5 * TAG_SIZE] call _fnc_isOk) || + {!([-0.5 * TAG_SIZE, 0.5 * TAG_SIZE] call _fnc_isOk) || + {!([-0.5 * TAG_SIZE,-0.5 * TAG_SIZE] call _fnc_isOk)}}}) exitWith { TRACE_3("Unsuitable location:",_touchingPoint); false }; diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index f7a643d882..7ec97a0c41 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -30,8 +30,7 @@ TRACE_1("",GVAR(trenchPlacementData)); [_unit, "forceWalk", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); // create the trench -private "_trench"; -_trench = createVehicle [_noGeoModel, [0, 0, 0], [], 0, "NONE"]; +private _trench = createVehicle [_noGeoModel, [0, 0, 0], [], 0, "NONE"]; GVAR(trench) = _trench; diff --git a/addons/vector/functions/fnc_adjustBrightness.sqf b/addons/vector/functions/fnc_adjustBrightness.sqf index 13c604315d..da951322af 100644 --- a/addons/vector/functions/fnc_adjustBrightness.sqf +++ b/addons/vector/functions/fnc_adjustBrightness.sqf @@ -1,14 +1,10 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private "_color"; - -_color = [[1,0,0,0.5], [1,0,0,1]] select (_this select 0); +private _color = [[1,0,0,0.5], [1,0,0,1]] select (_this select 0); (_dlgVector displayCtrl 1301) ctrlSetTextColor _color; (_dlgVector displayCtrl 1302) ctrlSetTextColor _color; diff --git a/addons/vector/functions/fnc_clearDisplay.sqf b/addons/vector/functions/fnc_clearDisplay.sqf index 81c919a8ca..73ef7dfcc6 100644 --- a/addons/vector/functions/fnc_clearDisplay.sqf +++ b/addons/vector/functions/fnc_clearDisplay.sqf @@ -7,10 +7,8 @@ Clears the vectors control items. */ #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); switch (_this select 0) do { case ("azimuth"): { diff --git a/addons/vector/functions/fnc_convertToTexturesDegree.sqf b/addons/vector/functions/fnc_convertToTexturesDegree.sqf index b94c2edf64..c572f5ef9b 100644 --- a/addons/vector/functions/fnc_convertToTexturesDegree.sqf +++ b/addons/vector/functions/fnc_convertToTexturesDegree.sqf @@ -6,14 +6,12 @@ converts azimuth into array of textures for the vectors scripted info control #include "script_component.hpp" -private "_number"; - -_number = _this select 0; +prams ["_number"]; if (GVAR(useMil)) then { _number = round (6400 / 360 * _number); - if (_number == 6400) then {_number = 0}; + if (_number isEqualTo 6400) then {_number = 0}; [_number] call FUNC(convertToTexturesDistance) // return @@ -21,23 +19,22 @@ if (GVAR(useMil)) then { _number = round _number; - private "_isNegative"; - _isNegative = _number < 0; + private _isNegative = _number < 0; _number = abs _number; - if (_number == 360) then {_number = 0}; + if (_number isEqualTo 360) then {_number = 0}; private ["_digit1", "_digit2", "_digit3", "_digit4"]; - _digit1 = floor (_number / 100); - _digit2 = floor (_number / 10) - _digit1 * 10; - _digit3 = _number mod 10; - _digit4 = QPATHTOF(rsc\vector_degree.paa); + private _digit1 = floor (_number / 100); + private _digit2 = floor (_number / 10) - _digit1 * 10; + private _digit3 = _number mod 10; + private _digit4 = QPATHTOF(rsc\vector_degree.paa); if (_isNegative) then { - if (_digit1 == 0) then { - if (_digit2 == 0) then { + if (_digit1 isEqualTo 0) then { + if (_digit2 isEqualTo 0) then { _digit1 = ""; _digit2 = QPATHTOF(rsc\vector_minus.paa); _digit3 = format [QPATHTOF(rsc\vector_%1.paa), _digit3]; @@ -55,8 +52,8 @@ if (GVAR(useMil)) then { } else { - if (_digit1 == 0) then { - if (_digit2 == 0) then { + if (_digit1 isEqualTo 0) then { + if (_digit2 isEqualTo 0) then { _digit1 = ""; _digit2 = ""; _digit3 = format [QPATHTOF(rsc\vector_%1.paa), _digit3]; diff --git a/addons/vector/functions/fnc_getDirection.sqf b/addons/vector/functions/fnc_getDirection.sqf index 3a131cbd19..c34826e218 100644 --- a/addons/vector/functions/fnc_getDirection.sqf +++ b/addons/vector/functions/fnc_getDirection.sqf @@ -15,13 +15,11 @@ _dlgVector = GETUVAR(ACE_dlgVector, displayNull); #define MAX_ABSINCLINATION 45 -private ["_position", "_direction", "_azimuth", "_inclination"]; +private _position = ATLToASL positionCameraToWorld [0,0,0]; +private _direction = ATLToASL positionCameraToWorld [0,0,1]; -_position = ATLToASL positionCameraToWorld [0,0,0]; -_direction = ATLToASL positionCameraToWorld [0,0,1]; - -_azimuth = ((_direction select 0) - (_position select 0)) atan2 ((_direction select 1) - (_position select 1)); -_inclination = asin ((_direction select 2) - (_position select 2)); +private _azimuth = ((_direction select 0) - (_position select 0)) atan2 ((_direction select 1) - (_position select 1)); +private _inclination = asin ((_direction select 2) - (_position select 2)); if (_azimuth < 0) then {_azimuth = _azimuth + 360}; if (abs _inclination > MAX_ABSINCLINATION) then {_inclination = -1000}; diff --git a/addons/vector/functions/fnc_illuminate.sqf b/addons/vector/functions/fnc_illuminate.sqf index cbf9d56fef..03508aae9e 100644 --- a/addons/vector/functions/fnc_illuminate.sqf +++ b/addons/vector/functions/fnc_illuminate.sqf @@ -1,18 +1,14 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); if (_this select 0) then { { if (ctrlIDC _x != 170) then { - private ["_string", "_index"]; - - _string = ctrlText _x; - _index = _string find ".paa"; + private _string = ctrlText _x; + private _index = _string find ".paa"; if (_index != -1 && {_string find "_illum.paa" == -1}) then { _string = toArray _string; @@ -25,10 +21,8 @@ if (_this select 0) then { } else { { if (ctrlIDC _x != 170) then { - private ["_string", "_index"]; - - _string = ctrlText _x; - _index = _string find "_illum.paa"; + private _string = ctrlText _x; + private _index = _string find "_illum.paa"; if (_index != -1) then { _string = toArray _string; diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index feb706bc02..830fb3c3c5 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -23,8 +23,7 @@ switch (GVAR(modeReticle)) do { }; }; -private "_fnc_setPFH"; -_fnc_setPFH = { +private _fnc_setPFH = { if (GVAR(holdKeyHandler) > -1) then { [GVAR(holdKeyHandler)] call CBA_fnc_removePerFrameHandler; GVAR(holdKeyHandler) = -1; diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index ee6d80e2de..3fdd637b61 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -20,8 +20,7 @@ if (!((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapo switch (_this select 0) do { case ("azimuth"): { - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; + private _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; [false] call FUNC(showCenter); @@ -41,8 +40,7 @@ switch (_this select 0) do { case ("distance"): { - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + private _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -65,8 +63,7 @@ switch (_this select 0) do { call FUNC(showAzimuth); - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + private _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -88,8 +85,7 @@ switch (_this select 0) do { case ("azimuth+inclination"): { - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; + private _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; [false] call FUNC(showCenter); @@ -109,8 +105,7 @@ switch (_this select 0) do { case ("height+distance"): { - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + private _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -131,8 +126,7 @@ switch (_this select 0) do { case ("relative_distance"): { - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5; + private _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5; [_isReady] call FUNC(showCenter); @@ -154,8 +148,7 @@ switch (_this select 0) do { case ("relative_height+length"): { - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5; + private _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5; [_isReady] call FUNC(showCenter); @@ -177,8 +170,7 @@ switch (_this select 0) do { case ("relative_azimuth+distance"): { - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + private _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -200,8 +192,7 @@ switch (_this select 0) do { case ("fall_of_shot"): { - private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + private _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); diff --git a/addons/vector/functions/fnc_onKeyUp.sqf b/addons/vector/functions/fnc_onKeyUp.sqf index aa768077d9..fc3d17700e 100644 --- a/addons/vector/functions/fnc_onKeyUp.sqf +++ b/addons/vector/functions/fnc_onKeyUp.sqf @@ -7,8 +7,7 @@ Handles releasing the special vector keys. */ #include "script_component.hpp" -private "_fnc_setPFH"; -_fnc_setPFH = { +private _fnc_setPFH = { if (GVAR(holdKeyHandler) > -1) then { [GVAR(holdKeyHandler)] call CBA_fnc_removePerFrameHandler; GVAR(holdKeyHandler) = -1; diff --git a/addons/vector/functions/fnc_showAzimuth.sqf b/addons/vector/functions/fnc_showAzimuth.sqf index 42e874d83c..2bedd4bf52 100644 --- a/addons/vector/functions/fnc_showAzimuth.sqf +++ b/addons/vector/functions/fnc_showAzimuth.sqf @@ -1,16 +1,12 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private ["_direction", "_digits"]; +private _direction = call FUNC(getDirection); -_direction = call FUNC(getDirection); - -_digits = _direction call FUNC(convertToTexturesDegree); +private _digits = _direction call FUNC(convertToTexturesDegree); (_dlgVector displayCtrl 1315) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); diff --git a/addons/vector/functions/fnc_showAzimuthInclination.sqf b/addons/vector/functions/fnc_showAzimuthInclination.sqf index 3daed0d4df..b00c035890 100644 --- a/addons/vector/functions/fnc_showAzimuthInclination.sqf +++ b/addons/vector/functions/fnc_showAzimuthInclination.sqf @@ -1,17 +1,13 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private ["_direction", "_digits"]; - -_direction = call FUNC(getDirection); +private _direction = call FUNC(getDirection); // azimuth -_digits = [_direction select 0] call FUNC(convertToTexturesDegree); +private _digits = [_direction select 0] call FUNC(convertToTexturesDegree); (_dlgVector displayCtrl 1315) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); diff --git a/addons/vector/functions/fnc_showDistance.sqf b/addons/vector/functions/fnc_showDistance.sqf index 540bd01824..380f784bbc 100644 --- a/addons/vector/functions/fnc_showDistance.sqf +++ b/addons/vector/functions/fnc_showDistance.sqf @@ -1,16 +1,12 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private ["_distance", "_digits"]; +private _distance = call FUNC(getDistance); -_distance = call FUNC(getDistance); - -_digits = [_distance] call FUNC(convertToTexturesDistance); +private _digits = [_distance] call FUNC(convertToTexturesDistance); (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 1); diff --git a/addons/vector/functions/fnc_showFallOfShot.sqf b/addons/vector/functions/fnc_showFallOfShot.sqf index 24d933815d..b7bed77a0b 100644 --- a/addons/vector/functions/fnc_showFallOfShot.sqf +++ b/addons/vector/functions/fnc_showFallOfShot.sqf @@ -3,20 +3,14 @@ GVAR(FOSState) = _this select 0; -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private "_fosData"; - -_fosData = GVAR(FOSData); +private _fosData = GVAR(FOSData); if !(_this select 0) then { - private "_digits"; - // of ordinate - _digits = [_fosData, 1] call FUNC(convertToTexturesFOS); + private _digits = [_fosData, 1] call FUNC(convertToTexturesFOS); (_dlgVector displayCtrl 1310) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 1); @@ -34,10 +28,8 @@ if !(_this select 0) then { (_dlgVector displayCtrl 1319) ctrlSetText (_digits select 4); } else { - private "_digits"; - // applicate - _digits = [_fosData, 2] call FUNC(convertToTexturesFOS); + private _digits = [_fosData, 2] call FUNC(convertToTexturesFOS); (_dlgVector displayCtrl 1310) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 1); diff --git a/addons/vector/functions/fnc_showHeightDistance.sqf b/addons/vector/functions/fnc_showHeightDistance.sqf index 67dde19547..b34e8111bc 100644 --- a/addons/vector/functions/fnc_showHeightDistance.sqf +++ b/addons/vector/functions/fnc_showHeightDistance.sqf @@ -1,17 +1,13 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private ["_heightDistance", "_digits"]; - -_heightDistance = call FUNC(getHeightDistance); +private _heightDistance = call FUNC(getHeightDistance); // height -_digits = [_heightDistance select 0] call FUNC(convertToTexturesDistance); +private _digits = [_heightDistance select 0] call FUNC(convertToTexturesDistance); (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 1); diff --git a/addons/vector/functions/fnc_showP1.sqf b/addons/vector/functions/fnc_showP1.sqf index 27f9063794..8d509d575f 100644 --- a/addons/vector/functions/fnc_showP1.sqf +++ b/addons/vector/functions/fnc_showP1.sqf @@ -7,10 +7,8 @@ Shows or hides the 1-P text line. */ #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); if (_this select 0) then { (_dlgVector displayCtrl 1321) ctrlSetText QPATHTOF(rsc\vector_1.paa); diff --git a/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf b/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf index e7c4378866..95797b9d6c 100644 --- a/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf +++ b/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf @@ -1,17 +1,13 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private ["_azimuthDistance", "_digits"]; - -_azimuthDistance = call FUNC(getRelativeAzimuthDistance); +private _azimuthDistance = call FUNC(getRelativeAzimuthDistance); // relative azimuth -_digits = [_azimuthDistance select 0] call FUNC(convertToTexturesDegree); +private _digits = [_azimuthDistance select 0] call FUNC(convertToTexturesDegree); (_dlgVector displayCtrl 1315) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); diff --git a/addons/vector/functions/fnc_showRelativeDistance.sqf b/addons/vector/functions/fnc_showRelativeDistance.sqf index cda17623f9..74b778d8bf 100644 --- a/addons/vector/functions/fnc_showRelativeDistance.sqf +++ b/addons/vector/functions/fnc_showRelativeDistance.sqf @@ -1,17 +1,13 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private ["_distance", "_digits"]; - -_distance = call FUNC(getRelativeDistance); +private _distance = call FUNC(getRelativeDistance); // relative slope distance -_digits = [_distance] call FUNC(convertToTexturesDistance); +private _digits = [_distance] call FUNC(convertToTexturesDistance); (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 1); diff --git a/addons/vector/functions/fnc_showRelativeHeightLength.sqf b/addons/vector/functions/fnc_showRelativeHeightLength.sqf index 7fed122786..0b9f5c1928 100644 --- a/addons/vector/functions/fnc_showRelativeHeightLength.sqf +++ b/addons/vector/functions/fnc_showRelativeHeightLength.sqf @@ -1,17 +1,13 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -private ["_heightLength", "_digits"]; - -_heightLength = call FUNC(getRelativeHeightLength); +private _heightLength = call FUNC(getRelativeHeightLength); // height -_digits = [_heightLength select 0] call FUNC(convertToTexturesDistance); +private _digits = [_heightLength select 0] call FUNC(convertToTexturesDistance); (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 1); diff --git a/addons/vector/functions/fnc_showText.sqf b/addons/vector/functions/fnc_showText.sqf index f9d85d84e3..b578269115 100644 --- a/addons/vector/functions/fnc_showText.sqf +++ b/addons/vector/functions/fnc_showText.sqf @@ -1,10 +1,8 @@ // by commy2 #include "script_component.hpp" -private "_dlgVector"; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); switch (_this select 0) do { case ("config"): { diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index 99e822d53d..82477f881c 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -41,8 +41,7 @@ if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not ac }; { - private "_unit"; - _unit = _x; + private _unit = _x; if (_unit isKindOf "CAManBase") then { { [_unit, _x, true] call FUNC(addKeyForVehicle); diff --git a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf index e959a705e0..957619a057 100644 --- a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf +++ b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf @@ -16,8 +16,6 @@ */ #include "script_component.hpp" -private ["_currentKeys"]; - params ["_veh", "_key"]; TRACE_2("params",_veh,_key); @@ -25,6 +23,6 @@ if (!isServer) exitWith {ERROR("only run on server");}; if (isNull _veh) exitWith {ERROR("null vehicle");}; if (_key == "") exitWith {ERROR("empty key string");}; -_currentKeys = _veh getVariable [QGVAR(customKeys), []]; +private _currentKeys = _veh getVariable [QGVAR(customKeys), []]; _currentKeys pushBack _key; _veh setVariable [QGVAR(customKeys), _currentKeys, true]; diff --git a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf index 9382de408e..113a4ad505 100644 --- a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf +++ b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf @@ -16,11 +16,9 @@ */ #include "script_component.hpp" -private ["_lockNumber"]; - params ["_veh", "_isLocked"]; TRACE_2("params",_veh,_isLocked); -_lockNumber = if (_isLocked) then {2} else {0}; +private _lockNumber = [0, 2] select _isLocked; TRACE_2("Setting Lock State", _veh, _lockNumber); _veh lock _lockNumber; diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 5ec512c903..acf8b2a9fa 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -18,7 +18,7 @@ [{ // BEGIN_COUNTER(pfeh); - private["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_trueSpeed", "_trueVelocity"]; + private ["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_trueSpeed", "_trueVelocity"]; params ["_args"]; _args params ["_lastTime"]; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 8e939369be..231f2cb08d 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -17,9 +17,7 @@ #include "script_component.hpp" -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if (_activated) then { @@ -100,11 +98,8 @@ if (_activated) then { //--- Handle ownership [_logic,_ownerVar,_ownerUID,_adminVar] spawn { scriptname "BIS_fnc_moduleCurator: Owner"; - - _logic = _this select 0; - _ownerVar = _this select 1; - _ownerUID = _this select 2; - _adminVar = _this select 3; + + params ["_logic", "_ownerVar", "_ownerUID", "_adminVar"]; if (_adminVar != "") then {_ownerVar = _adminVar;}; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 2f863ac5b9..5a14fbe218 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -16,9 +16,7 @@ #include "script_component.hpp" -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if (_activated) then { _explosive = gettext (configFile >> "CfgVehicles" >> typeOf _logic >> "explosive"); diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 68e6e30242..1a9da0ab02 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -18,18 +18,13 @@ #include "script_component.hpp" _fnc_scriptNameParentTemp = if !(isNil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; -private ['_fnc_scriptNameParent']; -_fnc_scriptNameParent = _fnc_scriptNameParentTemp; +private _fnc_scriptNameParent = _fnc_scriptNameParentTemp; _fnc_scriptNameParentTemp = nil; -private ['_fnc_scriptName']; -_fnc_scriptName = 'BIS_fnc_moduleProjectile'; +private _fnc_scriptName = 'BIS_fnc_moduleProjectile'; scriptname _fnc_scriptName; -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if ({local _x} count (objectcurators _logic) > 0) then { //--- Reveal the circle to curators diff --git a/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf b/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf index 3e655a0aca..d842a6c174 100644 --- a/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf +++ b/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf @@ -16,17 +16,16 @@ #include "script_component.hpp" params ["_vehicle"]; -private ["_fries", "_waitTime"]; _vehicle setVariable [QEGVAR(fastroping,doorsLocked), true, true]; -_waitTime = 2; +private _waitTime = 2; _vehicle animateDoor ["doorRB", 1]; _vehicle animateDoor ["doorLB", 1]; _vehicle animateDoor ["ramp_anim", 1]; -_fries = _vehicle getVariable [QEGVAR(fastroping,FRIES), objNull]; +private _fries = _vehicle getVariable [QEGVAR(fastroping,FRIES), objNull]; if !(isNull _fries) then { [{ _this animate ["extendHookRight", 1];