Scopes - Allow 0.05 mrad increments (#5840)

* Scopes - Allow 0.05 mrad increments
This commit is contained in:
ulteq 2017-12-02 16:23:41 +01:00 committed by GitHub
parent c5e594ffb8
commit 24b58fbb21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -51,8 +51,8 @@ if (_majorStep) then {
};
};
_elevation = round(_elevation * 10) / 10;
_windage = round(_windage * 10) / 10;
_elevation = round(_elevation / MIN_INCREMENT) * MIN_INCREMENT;
_windage = round(_windage / MIN_INCREMENT) * MIN_INCREMENT;
if ((_elevation + _zero) < _maxVertical select 0 or (_elevation + _zero) > _maxVertical select 1) exitWith {false};
if (_windage < _maxHorizontal select 0 or _windage > _maxHorizontal select 1) exitWith {false};

View File

@ -27,7 +27,7 @@ private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0
private _zeroing = _adjustment select _weaponIndex;
_zeroing params ["_elevation", "_windage", "_zero"];
_zero = round((_zero + _elevation) * 10) / 10;
_zero = round((_zero + _elevation) / MIN_INCREMENT) * MIN_INCREMENT;
_elevation = 0;
private _opticsClass = ([_unit] call FUNC(getOptics)) select _weaponIndex;

View File

@ -27,7 +27,7 @@ private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0
private _zeroing = _adjustment select _weaponIndex;
_zeroing params ["_elevation", "_windage", "_zero"];
_elevation = round((_zero + _elevation) * 10) / 10;
_elevation = round((_zero + _elevation) / MIN_INCREMENT) * MIN_INCREMENT;
_zero = 0;
private _opticsClass = ([_unit] call FUNC(getOptics)) select _weaponIndex;

View File

@ -14,7 +14,9 @@
#define MINOR_INCREMENT false
#define MAJOR_INCREMENT true
#define DEFAULT_RAIL_BASE_ANGLE 0.0086
#define MIN_INCREMENT 0.05 // mrad
#define DEFAULT_RAIL_BASE_ANGLE 0.0086 // deg
// #define DISABLE_DISPERSION