From c27d84e382bac05d0aa6630358139c18f1863ddd Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 14 May 2015 17:12:40 -0500 Subject: [PATCH] Common Privates Redo --- addons/common/XEH_postInit.sqf | 8 ++++-- addons/common/XEH_preInit.sqf | 4 ++- .../common/functions/fnc__handleNetEvent.sqf | 4 ++- .../fnc__handleRequestSyncedEvent.sqf | 3 +++ .../functions/fnc_addActionEventHandler.sqf | 1 + .../fnc_addActionMenuEventHandler.sqf | 1 + .../fnc_addCanInteractWithCondition.sqf | 2 ++ addons/common/functions/fnc_addSetting.sqf | 18 +++++++------ .../functions/fnc_addSyncedEventHandler.sqf | 2 ++ .../common/functions/fnc_addToInventory.sqf | 4 +-- addons/common/functions/fnc_cachedCall.sqf | 2 ++ .../fnc_changeProjectileDirection.sqf | 2 +- .../fnc_closeDialogIfTargetMoves.sqf | 2 ++ .../common/functions/fnc_disableUserInput.sqf | 1 + addons/common/functions/fnc_displayIcon.sqf | 4 +-- addons/common/functions/fnc_exportConfig.sqf | 2 +- .../fnc_fixLoweredRifleAnimation.sqf | 2 +- .../functions/fnc_getDisplayConfigName.sqf | 2 +- .../fnc_getFirstObjectIntersection.sqf | 2 +- .../fnc_getFirstTerrainIntersection.sqf | 2 +- addons/common/functions/fnc_getHitPoints.sqf | 2 +- .../fnc_getHitPointsWithSelections.sqf | 2 +- addons/common/functions/fnc_getItemType.sqf | 2 ++ .../functions/fnc_getNumberMagazinesIn.sqf | 4 ++- .../fnc_getReflectorsWithSelections.sqf | 2 +- .../functions/fnc_getTurretConfigPath.sqf | 2 +- .../functions/fnc_getTurretDirection.sqf | 2 +- addons/common/functions/fnc_getTurrets.sqf | 2 +- .../common/functions/fnc_getVehicleCargo.sqf | 2 +- .../functions/fnc_getVehicleCodriver.sqf | 2 +- addons/common/functions/fnc_globalEvent.sqf | 1 + addons/common/functions/fnc_goKneeling.sqf | 2 ++ .../common/functions/fnc_hadamardProduct.sqf | 2 ++ addons/common/functions/fnc_isEOD.sqf | 2 +- addons/common/functions/fnc_localEvent.sqf | 2 ++ addons/common/functions/fnc_logModEntries.sqf | 3 ++- .../common/functions/fnc_moduleCheckPBOs.sqf | 3 +++ .../functions/fnc_moduleLSDVehicles.sqf | 2 ++ .../common/functions/fnc_receiveRequest.sqf | 1 + .../fnc_removeSyncedEventHandler.sqf | 3 +++ .../common/functions/fnc_resetAllDefaults.sqf | 2 +- .../functions/fnc_revertKeyCodeLocalized.sqf | 2 +- addons/common/functions/fnc_serverEvent.sqf | 1 + .../functions/fnc_setSettingFromConfig.sqf | 18 ++++++------- addons/common/functions/fnc_subString.sqf | 26 ------------------- .../common/functions/fnc_syncedEventPFH.sqf | 2 +- addons/common/functions/fnc_targetEvent.sqf | 2 ++ addons/common/functions/fnc_toNumber.sqf | 2 +- .../functions/fnc_translateToModelSpace.sqf | 4 +++ .../functions/fnc_translateToWeaponSpace.sqf | 4 +++ addons/common/functions/fnc_useItem.sqf | 4 ++- addons/common/functions/fnc_useMagazine.sqf | 2 +- .../functions/fnc_worldToScreenBounds.sqf | 2 +- .../scripts/Version/checkVersionNumber.sqf | 2 ++ addons/common/scripts/assignedItemFix.sqf | 2 ++ addons/common/scripts/initScrollWheel.sqf | 13 +++++----- 56 files changed, 117 insertions(+), 82 deletions(-) delete mode 100644 addons/common/functions/fnc_subString.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 696aa16f9b..ba238c2796 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -1,6 +1,8 @@ // ACE - Common #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); + // Load settings from profile if (hasInterface) then { call FUNC(loadSettingsFromProfile); @@ -9,10 +11,9 @@ if (hasInterface) then { // Listens for global "SettingChanged" events, to update the force status locally ["SettingChanged", { - PARAMS_2(_name,_value); if !(count _this > 2) exitWith {}; - + private ["_force", "_settingData"]; _force = _this select 2; if (_force) then { _settingData = [_name] call FUNC(getSettingData); @@ -54,6 +55,7 @@ QGVAR(remoteFnc) addPublicVariableEventHandler { [missionNamespace] call FUNC(executePersistent); +private ["_currentVersion", "_previousVersion"]; // check previous version number from profile _currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); _previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; @@ -131,6 +133,7 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; // PFH to raise varios events [{ + private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen"]; // "playerInventoryChanged" event _newPlayerInventory = [ACE_player] call FUNC(getAllGear); if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { @@ -212,6 +215,7 @@ GVAR(OldIsCamera) = false; [{ // "activeCameraChanged" event + private ["_isCamera"]; _isCamera = {!isNull _x} count ALL_CAMERAS > 0; if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { // Raise ACE event locally diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 7c8f36163a..ce7623ea38 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -1,6 +1,8 @@ // by commy2 #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); + ADDON = false; // ACE Common Function @@ -170,7 +172,6 @@ PREP(sortAlphabeticallyBy); PREP(stringCompare); PREP(stringToColoredText); PREP(stringRemoveWhiteSpace); -PREP(subString); PREP(switchToGroupSide); PREP(throttledPublicVariable); PREP(toBin); @@ -302,6 +303,7 @@ if (hasInterface) then { // PFH to update the ACE_player variable [{ if !(ACE_player isEqualTo (call FUNC(player))) then { + private ["_oldPlayer"]; _oldPlayer = ACE_player; ACE_player = call FUNC(player); diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index 587dc379a5..7ee1f9c502 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -2,7 +2,9 @@ // internal handler for net events #include "script_component.hpp" -private ["_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged"]; +private ["_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged", "_events"]; +//IGNORE_PRIVATE_WARNING("_handleNetEvent"); + PARAMS_2(_eventType,_event); diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index 2d58aae869..3507071d39 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -17,6 +17,8 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" ++//IGNORE_PRIVATE_WARNING("_handleSyncedEvent"); + //SEH_s if(isServer) then { // Find the event name, and shovel out the events to the client @@ -33,6 +35,7 @@ if(isServer) then { ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); } else { PARAMS_2(_eventName,_eventLog); + private ["_eventArgs"]; // This is the client handling the response from the server // Start running the events { diff --git a/addons/common/functions/fnc_addActionEventHandler.sqf b/addons/common/functions/fnc_addActionEventHandler.sqf index a0e9d24f2c..29b058487b 100644 --- a/addons/common/functions/fnc_addActionEventHandler.sqf +++ b/addons/common/functions/fnc_addActionEventHandler.sqf @@ -15,6 +15,7 @@ #include "script_component.hpp" private ["_unit", "_action", "_condition", "_statement", "_name", "_actionsVar", "_actionID", "_actions", "_id", "_actionIDs"]; +//IGNORE_PRIVATE_WARNING("_count", "_index", "_return", "_target"); _unit = _this select 0; _action = _this select 1; diff --git a/addons/common/functions/fnc_addActionMenuEventHandler.sqf b/addons/common/functions/fnc_addActionMenuEventHandler.sqf index c307783455..268cc18d5a 100644 --- a/addons/common/functions/fnc_addActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_addActionMenuEventHandler.sqf @@ -19,6 +19,7 @@ #include "script_component.hpp" private ["_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; +//IGNORE_PRIVATE_WARNING("_target"); PARAMS_8(_unit,_displayName,_action,_condition,_statement,_condition2,_statement2,_priority); diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index ef46b23706..10ea084858 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -14,6 +14,8 @@ #include "script_component.hpp" private ["_conditionName", "_conditionFunc"]; +//IGNORE_PRIVATE_WARNING("_player", "_target"); + _conditionName = toLower (_this select 0); _conditionFunc = _this select 1; diff --git a/addons/common/functions/fnc_addSetting.sqf b/addons/common/functions/fnc_addSetting.sqf index ac62f20b3a..42299e6458 100644 --- a/addons/common/functions/fnc_addSetting.sqf +++ b/addons/common/functions/fnc_addSetting.sqf @@ -4,14 +4,14 @@ * If has only local effects. * * Arguments: - * 0: _name (String) - * 1: _typeName (String) - * 2: _isClientSetable (Bool) - * 3: _localizedName (String) - * 4: _localizedDescription (String) - * 5: _possibleValues (Array) - * 6: _isForced (Bool) - * 7: _defaultValue (Any) + * 0: name + * 1: typeName + * 2: isClientSetable + * 3: localizedName + * 4: localizedDescription + * 5: possibleValues + * 6: isForced + * 7: defaultValue (Any) * * Return Value: * None @@ -22,6 +22,8 @@ PARAMS_8(_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value); +private ["_settingData"]; + _settingData = [_name] call FUNC(getSettingData); // Exit if the setting already exists diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf index 5d2b221178..60c90672ef 100644 --- a/addons/common/functions/fnc_addSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -13,6 +13,8 @@ */ //#define DEBUG_MODE_FULL #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleSyncedEvent"); + PARAMS_2(_name,_handler); private["_ttl", "_eventId", "_data"]; diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index b319a92bd4..ba76831ba4 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -23,9 +23,7 @@ PARAMS_2(_unit,_classname); DEFAULT_PARAM(2,_container,""); DEFAULT_PARAM(3,_ammoCount,-1); -private "_addedToPlayer"; -private "_canAdd"; -private "_type"; +private ["_addedToPlayer", "_canAdd", "_type", "_pos"]; _canAdd = false; _addedToPlayer = true; diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index f1a351d224..c03d498eaa 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -19,6 +19,8 @@ PARAMS_5(_params,_function,_namespace,_uid,_duration); +//IGNORE_PRIVATE_WARNING("_eventName"); + if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then { _namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]]; diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index 849bf08c6e..b47ff0f96a 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -private ["_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"]; +private ["_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel", "_vlat"]; PARAMS_3(_projectile,_adjustDir,_adjustUp); diff --git a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf index f487fc5737..db60180bd1 100644 --- a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf +++ b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf @@ -14,6 +14,8 @@ _this spawn { PARAMS_2(_target,_ignoreDead); + private["_inVehicle", "_position", "_vehiclePlayer", "_vehicleTarget"]; + if (isNil "_ignoreDead") then {_ignoreDead = false}; _vehicleTarget = vehicle _target; diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 6284ae4551..520e4131b2 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -37,6 +37,7 @@ if (_state) then { _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); _dlg displayAddEventHandler ["KeyDown", { + private ["_key", "_dlg", "_ctrl", "_config", "_acc", "_index"]; _key = _this select 1; if (_key == 1 && {alive player}) then { diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index 3058c881a2..6561dbf63b 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -2,7 +2,7 @@ * Author: Glowbal * * Draw progress bar and execute given function if succesful. -* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] +* Finish/Failure/Conditional are all passed [args, elapsedTime, totalTime, errorCode] * * Argument: * 0: icon ID @@ -61,7 +61,7 @@ _refresh = { _allControls = []; - private ["_ctrl", "_setting"]; + private ["_ctrl", "_setting", "_position"]; _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; if (_setting > 0) then { { diff --git a/addons/common/functions/fnc_exportConfig.sqf b/addons/common/functions/fnc_exportConfig.sqf index b148f20a33..e8370c8f0f 100644 --- a/addons/common/functions/fnc_exportConfig.sqf +++ b/addons/common/functions/fnc_exportConfig.sqf @@ -9,7 +9,7 @@ private "_fnc_logEntries"; _fnc_logEntries = { - private ["_p", "_t", "_e"]; + private ["_p", "_t", "_e", "_a", "_i"]; PARAMS_2(_c,_d); diff --git a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf index f07477f11d..f39f85cc94 100644 --- a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf +++ b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf @@ -9,7 +9,7 @@ * Nothing * * Example: - * [_player] call ace_common_fnc_fixLoweredRifleAnimation + * [ACE_player] call ace_common_fnc_fixLoweredRifleAnimation * * Public: No */ diff --git a/addons/common/functions/fnc_getDisplayConfigName.sqf b/addons/common/functions/fnc_getDisplayConfigName.sqf index 4b8ffa58a2..92b6700238 100644 --- a/addons/common/functions/fnc_getDisplayConfigName.sqf +++ b/addons/common/functions/fnc_getDisplayConfigName.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_configName", "_index"]; +private ["_configName", "_index", "_config"]; _configName = ""; diff --git a/addons/common/functions/fnc_getFirstObjectIntersection.sqf b/addons/common/functions/fnc_getFirstObjectIntersection.sqf index a78152c052..3a99f244ed 100644 --- a/addons/common/functions/fnc_getFirstObjectIntersection.sqf +++ b/addons/common/functions/fnc_getFirstObjectIntersection.sqf @@ -9,7 +9,7 @@ */ #include "script_component.hpp" -private ["_distance", "_lower", "_upper", "_mid", "_intersections", "_result"]; +private ["_distance", "_lower", "_upper", "_mid", "_intersections", "_result", "_dir"]; PARAMS_3(_source,_destination,_accuracy); diff --git a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf index 7ec439ee01..2fe8242c15 100644 --- a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf +++ b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf @@ -9,7 +9,7 @@ */ #include "script_component.hpp" -private ["_distance", "_lower", "_upper", "_mid", "_intersection", "_result"]; +private ["_distance", "_lower", "_upper", "_mid", "_intersection", "_result", "_dir"]; PARAMS_3(_source,_destination,_accuracy); diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index bb788e4216..06b2b8d40b 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -11,7 +11,7 @@ */ #include "script_component.hpp" -private ["_config", "_hitpoints"]; +private ["_config", "_hitpoints", "_i"]; PARAMS_1(_vehicle); diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index 6398fa5a9d..2bf568ec8a 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -11,7 +11,7 @@ */ #include "script_component.hpp" -private ["_config", "_hitpoints", "_selections"]; +private ["_config", "_hitpoints", "_selections", "_i"]; PARAMS_1(_vehicle); diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index 174029cccb..4de2bfa862 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -16,6 +16,8 @@ PARAMS_1(_item); +private ["_cfgType"]; + _cfgType = [_item] call FUNC(getConfigType); if (_cfgType == "") exitWith {["",""]}; diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index 6b1d72097c..91921abd77 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -12,6 +12,8 @@ PARAMS_2(_unit,_magazine); +private ["_return"]; + _return = 0; if (_unit isKindOf "CAManBase") then { _return = {_x == _magazine} count magazines _unit; @@ -23,4 +25,4 @@ if (_unit isKindOf "CAManBase") then { _return = _return + ({_x == _magazine} count getMagazineCargo _unit); }; -_return \ No newline at end of file +_return diff --git a/addons/common/functions/fnc_getReflectorsWithSelections.sqf b/addons/common/functions/fnc_getReflectorsWithSelections.sqf index 56806d55db..d50269ade8 100644 --- a/addons/common/functions/fnc_getReflectorsWithSelections.sqf +++ b/addons/common/functions/fnc_getReflectorsWithSelections.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -private ["_config", "_hitpoints", "_selections"]; +private ["_config", "_hitpoints", "_selections", "_i"]; PARAMS_1(_vehicle); diff --git a/addons/common/functions/fnc_getTurretConfigPath.sqf b/addons/common/functions/fnc_getTurretConfigPath.sqf index 8c62b958b5..1fca65eaac 100644 --- a/addons/common/functions/fnc_getTurretConfigPath.sqf +++ b/addons/common/functions/fnc_getTurretConfigPath.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -private ["_index", "_offset", "_config2", "_foundClasses"]; +private ["_index", "_offset", "_config2", "_foundClasses", "_a"]; PARAMS_2(_config,_turretIndex); diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index 79977e4d8c..d3a49f84f1 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" PARAMS_2(_vehicle,_position); -private ["_turrets", "_turret", "_config", "_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov"]; +private ["_turrets", "_turret", "_config", "_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov", "_gunBeg", "_gunEnd", "_pipDir"]; _turret = [_vehicle, _position] call CBA_fnc_getTurret; _pov = getText (_turret >> "memoryPointGunnerOptics"); diff --git a/addons/common/functions/fnc_getTurrets.sqf b/addons/common/functions/fnc_getTurrets.sqf index 97d80312d3..ea656941e4 100644 --- a/addons/common/functions/fnc_getTurrets.sqf +++ b/addons/common/functions/fnc_getTurrets.sqf @@ -11,7 +11,7 @@ */ #include "script_component.hpp" -private ["_config", "_turrets", "_fnc_addTurret"]; +private ["_config", "_turrets", "_fnc_addTurret", "_varName"]; PARAMS_1(_type); diff --git a/addons/common/functions/fnc_getVehicleCargo.sqf b/addons/common/functions/fnc_getVehicleCargo.sqf index 2988085d19..4b8ca63f5c 100644 --- a/addons/common/functions/fnc_getVehicleCargo.sqf +++ b/addons/common/functions/fnc_getVehicleCargo.sqf @@ -11,7 +11,7 @@ */ #include "script_component.hpp" -private ["_config", "_cargo", "_codrivers"]; +private ["_config", "_cargo", "_codrivers", "_index"]; PARAMS_1(_vehicle); diff --git a/addons/common/functions/fnc_getVehicleCodriver.sqf b/addons/common/functions/fnc_getVehicleCodriver.sqf index 7951c01d13..019c7b9971 100644 --- a/addons/common/functions/fnc_getVehicleCodriver.sqf +++ b/addons/common/functions/fnc_getVehicleCodriver.sqf @@ -11,7 +11,7 @@ */ #include "script_component.hpp" -private ["_config", "_cargo", "_codrivers"]; +private ["_config", "_cargo", "_codrivers", "_index"]; PARAMS_1(_vehicle); diff --git a/addons/common/functions/fnc_globalEvent.sqf b/addons/common/functions/fnc_globalEvent.sqf index af9d080ac9..b605a406b1 100644 --- a/addons/common/functions/fnc_globalEvent.sqf +++ b/addons/common/functions/fnc_globalEvent.sqf @@ -11,6 +11,7 @@ * Nothing */ #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleNetEvent"); PARAMS_2(_eventName,_eventArgs); diff --git a/addons/common/functions/fnc_goKneeling.sqf b/addons/common/functions/fnc_goKneeling.sqf index 614ea34ee9..0ff25b460f 100644 --- a/addons/common/functions/fnc_goKneeling.sqf +++ b/addons/common/functions/fnc_goKneeling.sqf @@ -13,6 +13,8 @@ PARAMS_1(_unit); +//IGNORE_PRIVATE_WARNING("_exception"); + try { if (_unit == vehicle _unit) then { switch (currentWeapon _unit) do { diff --git a/addons/common/functions/fnc_hadamardProduct.sqf b/addons/common/functions/fnc_hadamardProduct.sqf index 5503643026..b063b35313 100644 --- a/addons/common/functions/fnc_hadamardProduct.sqf +++ b/addons/common/functions/fnc_hadamardProduct.sqf @@ -15,6 +15,8 @@ PARAMS_2(_vector1,_vector2); +private ["_newVector", "_i"]; + _newVector = []; for "_i" from 0 to (((count _vector1) min (count _vector2)) - 1) do { diff --git a/addons/common/functions/fnc_isEOD.sqf b/addons/common/functions/fnc_isEOD.sqf index 11fbf45306..92c5dc6dc4 100644 --- a/addons/common/functions/fnc_isEOD.sqf +++ b/addons/common/functions/fnc_isEOD.sqf @@ -16,7 +16,7 @@ BOOLEAN Example: - _isSpecialist = [player] call FUNC(isEOD); + isSpecialist = [player] call FUNC(isEOD); */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_localEvent.sqf b/addons/common/functions/fnc_localEvent.sqf index 0b8c218eca..256282f97f 100644 --- a/addons/common/functions/fnc_localEvent.sqf +++ b/addons/common/functions/fnc_localEvent.sqf @@ -14,6 +14,8 @@ PARAMS_2(_eventName,_eventArgs); +private["_eventIndex", "_eventNames", "_events"]; + _eventNames = GVAR(events) select 0; _eventIndex = _eventNames find _eventName; if(_eventIndex != -1) then { diff --git a/addons/common/functions/fnc_logModEntries.sqf b/addons/common/functions/fnc_logModEntries.sqf index 4b94c557bc..ec8c94b190 100644 --- a/addons/common/functions/fnc_logModEntries.sqf +++ b/addons/common/functions/fnc_logModEntries.sqf @@ -1,6 +1,7 @@ // by commy2 +#include "script_component.hpp" -private ["_configs", "_entries"]; +private ["_configs", "_entries", "_name"]; _configs = "true" configClasses (configFile >> _this); diff --git a/addons/common/functions/fnc_moduleCheckPBOs.sqf b/addons/common/functions/fnc_moduleCheckPBOs.sqf index e0fa562e8c..05e1037028 100644 --- a/addons/common/functions/fnc_moduleCheckPBOs.sqf +++ b/addons/common/functions/fnc_moduleCheckPBOs.sqf @@ -13,6 +13,8 @@ PARAMS_3(_logic,_units,_activated); +private ["_mode", "_checkAll", "_whitelist"]; + if !(_activated) exitWith {}; _mode = parseNumber (_logic getVariable "Action"); @@ -30,6 +32,7 @@ ACE_Version_Whitelist = _whitelist; if (!isServer) then { [_mode, _checkAll, _whitelist] spawn { + private ["_mode", "_checkAll", "_whitelist", "_missingAddon", "_missingAddonServer", "_oldVersionClient", "_oldVersionServer", "_text", "_error", "_rscLayer", "_ctrlHint"]; _mode = _this select 0; _checkAll = _this select 1; _whitelist = _this select 2; diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index dec118231d..59744016ce 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -13,6 +13,8 @@ PARAMS_3(_logic,_units,_activated); +private["_colors", "_hSCount", "_hiddenSelections", "_i", "_index", "_vehicle"]; + if !(_activated) exitWith {}; { diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index e6c39c1959..e7857b9436 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -42,6 +42,7 @@ GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = _target addAction ["Decline", compile GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = _requestID; GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [time, _target, _requestID] spawn { + private["_id", "_t", "_requestID", "_target"]; _t = (_this select 0) + 40; _target = _this select 1; _requestID = _this select 2; diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 835b26e526..84aa98c0ea 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -10,8 +10,11 @@ * Boolean of success */ #include "script_component.hpp" + PARAMS_1(_name); +private ["_data", "_eventId"]; + if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { diag_log text format["[ACE] Error, synced event key not found."]; false diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index efa69d9059..61dc11f659 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -27,7 +27,7 @@ if (isPlayer _unit) then { if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { // clear all disable user input { - [_X, false] call FUNC(setDisableUserInputStatus); + [_x, false] call FUNC(setDisableUserInputStatus); }foreach GVAR(DISABLE_USER_INPUT_COLLECTION); }; }; diff --git a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf index 4acf460438..75168d4e84 100644 --- a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf +++ b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf @@ -11,7 +11,7 @@ */ #include "script_component.hpp" -private ["_key", "_alt", "_ctrl", "_shft"]; +private ["_key", "_alt", "_ctrl", "_shift"]; PARAMS_1(_keyCode); diff --git a/addons/common/functions/fnc_serverEvent.sqf b/addons/common/functions/fnc_serverEvent.sqf index 73bb77c600..9227b1a783 100644 --- a/addons/common/functions/fnc_serverEvent.sqf +++ b/addons/common/functions/fnc_serverEvent.sqf @@ -11,6 +11,7 @@ * Nothing */ #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleNetEvent"); PARAMS_2(_eventName,_eventArgs); diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index adb9f7ef35..9a95819996 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -14,7 +14,7 @@ PARAMS_1(_optionEntry); -private ["_fnc_getValueWithType", "_value","_name", "_typeName", "_settingData"]; +private ["_fnc_getValueWithType", "_value","_name", "_typeName", "_settingData", "_valueConfig", "_text"]; _fnc_getValueWithType = { EXPLODE_2_PVT(_this,_optionEntry,_typeName); @@ -58,14 +58,14 @@ if (isNil _name) then { // Add the setting to a list on the server // Set the variable to not forced /*_settingData = [ - _name, - _typeName, - _isClientSettable, - _localizedName, - _localizedDescription, - _possibleValues, - _isForced, - _defaultValue + name, + typeName, + isClientSettable, + localizedName, + localizedDescription, + possibleValues, + isForced, + defaultValue ];*/ _settingData = [ _name, diff --git a/addons/common/functions/fnc_subString.sqf b/addons/common/functions/fnc_subString.sqf deleted file mode 100644 index eeadfffa62..0000000000 --- a/addons/common/functions/fnc_subString.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Returns a fraction of the given string, starting at a given index, with a given length. - * - * Arguments: - * 0: Source string - * 1: Starting index of new string - * 2: Length of the new string - * - * Return Value: - * String when successfull / False when not - */ -#include "script_component.hpp" - -PARAMS_3(_string,_index,_length); - -_array = toArray _string; -if (_index < 0 or _length < 0 or _index + _length > (count _array) + 1) exitWith {false}; - -_arrayNew = []; -for "_i" from _index to (_index + _length - 1) do { - _arrayNew = _arrayNew + [(_array select _i)]; -}; - -toString _arrayNew diff --git a/addons/common/functions/fnc_syncedEventPFH.sqf b/addons/common/functions/fnc_syncedEventPFH.sqf index e8a21202ab..2762ae2656 100644 --- a/addons/common/functions/fnc_syncedEventPFH.sqf +++ b/addons/common/functions/fnc_syncedEventPFH.sqf @@ -7,7 +7,7 @@ if(!isServer) exitWith { false }; // @TODO: This should be iteration limited to prevent FPS lag private["_data"]; { - private["_data", "_ttl", "_eventLog", "_newEventLog", "_name"]; + private["_data", "_ttl", "_eventLog", "_newEventLog", "_name", "_globalEventTTL"]; _name = _x; _data = HASH_GET(GVAR(syncedEvents),_name); diff --git a/addons/common/functions/fnc_targetEvent.sqf b/addons/common/functions/fnc_targetEvent.sqf index cb78c29c18..22bd7431f5 100644 --- a/addons/common/functions/fnc_targetEvent.sqf +++ b/addons/common/functions/fnc_targetEvent.sqf @@ -16,6 +16,8 @@ */ #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleNetEvent"); + PARAMS_3(_eventName,_eventTargets,_eventArgs); #ifdef DEBUG_EVENTS diff --git a/addons/common/functions/fnc_toNumber.sqf b/addons/common/functions/fnc_toNumber.sqf index 9c4203e07e..55a9ba2787 100644 --- a/addons/common/functions/fnc_toNumber.sqf +++ b/addons/common/functions/fnc_toNumber.sqf @@ -14,7 +14,7 @@ NUMBER Example: - _number = ["102"] call FUNC(toNumber); + number = ["102"] call FUNC(toNumber); */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_translateToModelSpace.sqf b/addons/common/functions/fnc_translateToModelSpace.sqf index 1e2e930ac7..d2dfa38643 100644 --- a/addons/common/functions/fnc_translateToModelSpace.sqf +++ b/addons/common/functions/fnc_translateToModelSpace.sqf @@ -1,3 +1,7 @@ +#include "script_component.hpp" + +private["_matrix", "_object", "_offset", "_origin", "_out", "_xVec", "_y", "_yVec", "_z", "_zVec"]; + _object = _this select 0; _origin = getPosASL _object; _matrix = _this select 1; diff --git a/addons/common/functions/fnc_translateToWeaponSpace.sqf b/addons/common/functions/fnc_translateToWeaponSpace.sqf index 2c7dc5e6da..ca1544b317 100644 --- a/addons/common/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/common/functions/fnc_translateToWeaponSpace.sqf @@ -1,3 +1,7 @@ +#include "script_component.hpp" + +private["_matrix", "_object", "_offset", "_origin", "_out", "_xVec", "_y", "_yVec", "_z", "_zVec"]; + _object = _this select 0; _origin = getPosASL _object; _matrix = _this select 1; diff --git a/addons/common/functions/fnc_useItem.sqf b/addons/common/functions/fnc_useItem.sqf index cc4d0491fd..03589cd56d 100644 --- a/addons/common/functions/fnc_useItem.sqf +++ b/addons/common/functions/fnc_useItem.sqf @@ -10,8 +10,10 @@ #include "script_component.hpp" -private ["_return"]; PARAMS_2(_unit,_item); + +private ["_return", "_vehicleUsage"]; + _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; _return = false; diff --git a/addons/common/functions/fnc_useMagazine.sqf b/addons/common/functions/fnc_useMagazine.sqf index e29c3489ef..f21a04d026 100644 --- a/addons/common/functions/fnc_useMagazine.sqf +++ b/addons/common/functions/fnc_useMagazine.sqf @@ -10,7 +10,7 @@ #include "script_component.hpp" -private ["_return"]; +private ["_return", "_vehicleUsage"]; PARAMS_2(_unit,_magazine); _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; diff --git a/addons/common/functions/fnc_worldToScreenBounds.sqf b/addons/common/functions/fnc_worldToScreenBounds.sqf index afb5817d81..b3b5ba3f1e 100644 --- a/addons/common/functions/fnc_worldToScreenBounds.sqf +++ b/addons/common/functions/fnc_worldToScreenBounds.sqf @@ -5,7 +5,7 @@ #include "script_component.hpp" -private ["_minX","_minY","_maxX","_maxY"]; +private ["_minX","_minY","_maxX","_maxY", "_bounds", "_boundsCorners", "_boundsMax", "_boundsMaxX", "_boundsMaxY", "_boundsMaxZ", "_boundsMin", "_boundsMinX", "_boundsMinY", "_boundsMinZ"]; PARAMS_3(_object,_margins,_offsets); diff --git a/addons/common/scripts/Version/checkVersionNumber.sqf b/addons/common/scripts/Version/checkVersionNumber.sqf index 74f130596a..07bd443a06 100644 --- a/addons/common/scripts/Version/checkVersionNumber.sqf +++ b/addons/common/scripts/Version/checkVersionNumber.sqf @@ -1,6 +1,8 @@ // 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"]; + _files = []; { diff --git a/addons/common/scripts/assignedItemFix.sqf b/addons/common/scripts/assignedItemFix.sqf index c118115bed..bcf79a3ac1 100644 --- a/addons/common/scripts/assignedItemFix.sqf +++ b/addons/common/scripts/assignedItemFix.sqf @@ -1,6 +1,8 @@ // by commy2 #include "script_component.hpp" +private ["_config"]; + ACE_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; // default value is 1, so do isNumber check first ACE_isCompassEnabled = call {_config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; ACE_isWatchEnabled = call {_config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; diff --git a/addons/common/scripts/initScrollWheel.sqf b/addons/common/scripts/initScrollWheel.sqf index 5a8bf57d79..78920bb371 100644 --- a/addons/common/scripts/initScrollWheel.sqf +++ b/addons/common/scripts/initScrollWheel.sqf @@ -4,12 +4,13 @@ GVAR(ScrollWheelFrame) = diag_frameno; GVAR(onScrollWheel) = { - _scroll = _this select 1; + private ["_scroll"]; + _scroll = _this select 1; - if (GVAR(ScrollWheelFrame) == diag_frameno) exitWith {}; - GVAR(ScrollWheelFrame) = diag_frameno; + if (GVAR(ScrollWheelFrame) == diag_frameno) exitWith {}; + GVAR(ScrollWheelFrame) = diag_frameno; - { - [_scroll] call _x; - } count ((missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]) select 2); + { + [_scroll] call _x; + } count ((missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]) select 2); };