diff --git a/addons/rangecard/functions/fnc_calculateRangeCard.sqf b/addons/rangecard/functions/fnc_calculateRangeCard.sqf index 7edd865ddc..2cdcb391f5 100644 --- a/addons/rangecard/functions/fnc_calculateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_calculateRangeCard.sqf @@ -17,8 +17,9 @@ * 11: ballistic coefficient * 12: drag model * 13: atmosphere model - * 14: Range Card Slot - * 15: Use advanced ballistics config? + * 14: transonicStabilityCoef + * 15: Range Card Slot + * 16: Use advanced ballistics config? * * Return Value: * Nothing @@ -33,7 +34,7 @@ params [ "_scopeBaseAngle", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed", "_targetSpeed", "_targetRange", "_bc", "_dragModel", "_atmosphereModel", - "_rangeCardSlot", "_useABConfig" + "_transonicStabilityCoef", "_rangeCardSlot", "_useABConfig" ]; GVAR(rangeCardDataMVs) set [_rangeCardSlot, format[" %1", round(_muzzleVelocity)]]; @@ -96,8 +97,7 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _stepsTotal = _stepsTotal + 1; _speedAverage = (_speedTotal / _stepsTotal); - if (_speedAverage > 450 && _bulletSpeed < _speedOfSound) exitWith {}; - if (atan((_bulletPos select 2) / (abs(_bulletPos select 1) + 1)) < -2.254) exitWith {}; + if (_transonicStabilityCoef < 1.0 && _speedAverage > 450 && _bulletSpeed < _speedOfSound) exitWith {}; _trueVelocity = _bulletVelocity vectorDiff [-_windSpeed, 0, 0]; _trueSpeed = vectorMagnitude _trueVelocity; @@ -115,6 +115,8 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply (_deltaT * 0.5)); _bulletVelocity = _bulletVelocity vectorAdd (_bulletAccel vectorMultiply _deltaT); _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply (_deltaT * 0.5)); + + if (atan((_bulletPos select 2) / (abs(_bulletPos select 1) + 1)) < -2.254) exitWith {}; _TOF = _TOF + _deltaT; diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index 41234376fc..23a63641c5 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -21,7 +21,7 @@ disableSerialization; #define __dsp (uiNamespace getVariable "RangleCard_Display") -private ["_airFriction", "_ammoConfig", "_atmosphereModel", "_barrelLength", "_barrelTwist", "_bc", "_boreHeight", "_cacheEntry", "_column", "_control", "_dragModel", "_i", "_muzzleVelocity", "_offset", "_row", "_weaponConfig", "_initSpeed", "_initSpeedCoef"]; +private ["_airFriction", "_ammoConfig", "_atmosphereModel", "_transonicStabilityCoef", "_barrelLength", "_barrelTwist", "_bc", "_boreHeight", "_cacheEntry", "_column", "_control", "_dragModel", "_i", "_muzzleVelocity", "_offset", "_row", "_weaponConfig", "_initSpeed", "_initSpeedCoef"]; params ["_zeroRange", "_ammoClass", "_magazineClass", "_weaponClass"]; @@ -103,6 +103,7 @@ _bc = 0; if (count (_ammoConfig select 6) > 0) then { _bc = (_ammoConfig select 6) select 0; }; +_transonicStabilityCoef = _ammoConfig select 4; _dragModel = _ammoConfig select 5; _atmosphereModel = _ammoConfig select 8; _boreHeight = 3.81; @@ -170,10 +171,10 @@ if (isNil {_cacheEntry}) then { private _mvShift = [_ammoConfig select 9, _x] call EFUNC(advanced_ballistics,calculateAmmoTemperatureVelocityShift); private _mv = _muzzleVelocity + _mvShift; - [_scopeBaseAngle,_boreHeight,_airFriction,_mv,_x,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_forEachIndex,_useABConfig] call FUNC(calculateRangeCard); + [_scopeBaseAngle,_boreHeight,_airFriction,_mv,_x,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,_forEachIndex,_useABConfig] call FUNC(calculateRangeCard); } forEach [-15, -5, 5, 10, 15, 20, 25, 30, 35]; } else { - [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,4,_useABConfig] call FUNC(calculateRangeCard); + [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,4,_useABConfig] call FUNC(calculateRangeCard); }; for "_i" from 0 to 9 do {