From 07ab8751a6dfe511c0c58fe300a157242514d3f0 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 11 Sep 2023 20:44:25 -0500 Subject: [PATCH] XM157 - Fix spin drift offset when using advanced ballistics (#9392) xm157 - Fix spin drift calc when using ab --- addons/xm157/functions/fnc_ballistics_calculator.sqf | 2 +- addons/xm157/functions/fnc_weaponInfo_drawMenu.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/xm157/functions/fnc_ballistics_calculator.sqf b/addons/xm157/functions/fnc_ballistics_calculator.sqf index e017cd45b7..97ac8c8f5e 100644 --- a/addons/xm157/functions/fnc_ballistics_calculator.sqf +++ b/addons/xm157/functions/fnc_ballistics_calculator.sqf @@ -95,7 +95,7 @@ if (_useAB && {(_bulletPos select 1) > 0}) then { }; private _spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; private _spinDrift = - atan(_spinDeflection / (_bulletPos select 1)); - private _windage = _windage + _spinDrift; + _windage = _windage + _spinDrift; }; [17.453*_elevation, 17.453*_windage] // Convert to MRAD and return diff --git a/addons/xm157/functions/fnc_weaponInfo_drawMenu.sqf b/addons/xm157/functions/fnc_weaponInfo_drawMenu.sqf index 63ebe540ef..97ea72f8a2 100644 --- a/addons/xm157/functions/fnc_weaponInfo_drawMenu.sqf +++ b/addons/xm157/functions/fnc_weaponInfo_drawMenu.sqf @@ -22,7 +22,7 @@ if (isNil QGVAR(menu)) then { private _arrayUp = { params ["", "_var", "_thing"]; private _value = GVAR(data) getOrDefault [_var, 0]; - private _value = (_value + 1 + count _thing) % count _thing; + _value = (_value + 1 + count _thing) % count _thing; GVAR(data) set [_var, _value]; }; private _arrayDown = {