diff --git a/addons/scopes/ACE_Settings.hpp b/addons/scopes/ACE_Settings.hpp index 29d6635cf2..6ff483cb50 100644 --- a/addons/scopes/ACE_Settings.hpp +++ b/addons/scopes/ACE_Settings.hpp @@ -20,6 +20,13 @@ class ACE_Settings { displayName = CSTRING(correctZeroing_displayName); description = CSTRING(correctZeroing_description); }; + // Enables the use of the 'defaultZeroRange' setting to overwrite the discreteDistance[] config + class GVAR(overwriteZeroRange) { + typeName = "BOOL"; + value = 0; + displayName = CSTRING(overwriteZeroRange_displayName); + description = CSTRING(overwriteZeroRange_description); + }; // Only affects scopes with elevation adjustment turrets (ACE_ScopeAdjust_Vertical != [0,0]) class GVAR(defaultZeroRange) { typeName = "SCALAR"; diff --git a/addons/scopes/CfgVehicles.hpp b/addons/scopes/CfgVehicles.hpp index 4a23ea0baf..fd2a7d01c6 100644 --- a/addons/scopes/CfgVehicles.hpp +++ b/addons/scopes/CfgVehicles.hpp @@ -46,6 +46,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class overwriteZeroRange { + displayName = CSTRING(overwriteZeroRange_DisplayName); + description = CSTRING(overwriteZeroRange_Description); + typeName = "BOOL"; + defaultValue = 0; + }; class defaultZeroRange { displayName = CSTRING(defaultZeroRange_DisplayName); description = CSTRING(defaultZeroRange_Description); diff --git a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf index 0f7fe746eb..a82bd0714e 100644 --- a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf +++ b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf @@ -30,7 +30,7 @@ private _opticConfig = if (_optic != "") then { }; private _zeroRange = currentZeroing _unit; -if (GVAR(canAdjustElevation) select _weaponIndex) then { +if (GVAR(overwriteZeroRange) && {GVAR(canAdjustElevation) select _weaponIndex}) then { _zeroRange = GVAR(defaultZeroRange); }; if (isNumber (_opticConfig >> "ACE_ScopeZeroRange")) then { diff --git a/addons/scopes/functions/fnc_initModuleSettings.sqf b/addons/scopes/functions/fnc_initModuleSettings.sqf index 91ab202db3..a04433f11e 100644 --- a/addons/scopes/functions/fnc_initModuleSettings.sqf +++ b/addons/scopes/functions/fnc_initModuleSettings.sqf @@ -21,6 +21,7 @@ if !(_activated) exitWith {}; [_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(forceUseOfAdjustmentTurrets), "forceUseOfAdjustmentTurrets"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(correctZeroing), "correctZeroing"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(overwriteZeroRange), "overwriteZeroRange"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(defaultZeroRange), "defaultZeroRange"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(zeroReferenceTemperature), "zeroReferenceTemperature"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(zeroReferenceBarometricPressure), "zeroReferenceBarometricPressure"] call EFUNC(common,readSettingFromModule); diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index f74325ab62..bffaeb0301 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -22,6 +22,12 @@ Corrects the zeroing of all small arms sights + + Overwrite zero distance + + + Uses the 'defaultZeroRange' setting to overwrite the zero range of high power scopes + Default zero distance