Skip to content

Commit

Permalink
Scopes - Fixed MRAD conversion (#5651)
Browse files Browse the repository at this point in the history
* Same issue as #5640
  • Loading branch information
ulteq authored Oct 22, 2017
1 parent 0aca46d commit 3484942
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/scopes/functions/fnc_applyScopeAdjustment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ playSound selectRandom ["ACE_Scopes_Click_1", "ACE_Scopes_Click_2", "ACE_Scopes_
// slightly rotate the player if looking through optic
if (cameraView == "GUNNER") then {
// Convert adjustmentDifference from mils to degrees
_adjustmentDifference = _adjustmentDifference apply {_x * 0.05625};
_adjustmentDifference = _adjustmentDifference apply {MRAD_TO_DEG(_x)};
_adjustmentDifference params ["_elevationDifference", "_windageDifference"];
private _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw);
_pitchBankYaw params ["_pitch", "_bank", "_yaw"];
Expand Down
2 changes: 1 addition & 1 deletion addons/scopes/functions/fnc_firedEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private _zeroing = +(_adjustment select _weaponIndex);
TRACE_1("Adjusting With",_zeroing);

// Convert zeroing from mils to degrees
_zeroing = _zeroing vectorMultiply 0.05625;
_zeroing = _zeroing vectorMultiply MRAD_TO_DEG(1);

if (GVAR(correctZeroing)) then {
private _advancedBallistics = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false];
Expand Down
2 changes: 2 additions & 0 deletions addons/scopes/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_SCOPES
#endif

#define MRAD_TO_DEG(d) (d / 17.45329252) // Conversion factor: 9 / (50 * PI)

#include "\z\ace\addons\main\script_macros.hpp"

0 comments on commit 3484942

Please sign in to comment.