mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed the ATragMX 'AdvancedBallistics detection routine'
This commit is contained in:
parent
ad3c9493d7
commit
25ec665f45
@ -49,10 +49,8 @@ if (_storeRangeCardData) then {
|
||||
|
||||
private ["_wind"];
|
||||
_wind = [cos(270 - _windDirection * 30) * _windSpeed, sin(270 - _windDirection * 30) * _windSpeed, 0];
|
||||
if (EGVAR(advanced_ballistics,AdvancedBallistics)) then {
|
||||
if (EGVAR(advanced_ballistics,AdvancedAirDragEnabled)) then {
|
||||
_bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection);
|
||||
};
|
||||
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then {
|
||||
_bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection);
|
||||
};
|
||||
|
||||
_TOF = 0;
|
||||
@ -71,8 +69,8 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do {
|
||||
_trueVelocity = _bulletVelocity vectorDiff _wind;
|
||||
_trueSpeed = vectorMagnitude _trueVelocity;
|
||||
|
||||
if (EGVAR(advanced_ballistics,AdvancedBallistics)) then {
|
||||
if (EGVAR(advanced_ballistics,AdvancedAirDragEnabled)) then {
|
||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false]) then {
|
||||
private ["_drag"];
|
||||
_drag = -1 * ([_dragModel, _bc, _trueSpeed] call EFUNC(advanced_ballistics,calculateRetardation));
|
||||
_bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (_drag);
|
||||
|
@ -1,8 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNil QUOTE(EGVAR(advanced_ballistics,AdvancedBallistics))) then { EGVAR(advanced_ballistics,AdvancedBallistics) = false; };
|
||||
if (isNil QUOTE(EGVAR(advanced_ballistics,AdvancedAirDragEnabled))) then { EGVAR(advanced_ballistics,AdvancedAirDragEnabled) = false; };
|
||||
|
||||
GVAR(workingMemory) = [+(GVAR(gunList) select 0), +(GVAR(gunList) select 0), +(GVAR(gunList) select 0), +(GVAR(gunList) select 0)];
|
||||
|
||||
GVAR(scopeUnits) = ["MILs", "TMOA", "SMOA", "Clicks"];
|
||||
|
@ -13,7 +13,7 @@ GVAR(targetRange) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 340))
|
||||
private ["_boreHeight", "_bulletMass", "_airFriction", "_muzzleVelocity"];
|
||||
_boreHeight = parseNumber(ctrlText 100);
|
||||
_bulletMass = parseNumber(ctrlText 110);
|
||||
if (EGVAR(advanced_ballistics,AdvancedBallistics) && EGVAR(advanced_ballistics,AdvancedAirDragEnabled)) then {
|
||||
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then {
|
||||
_airFriction = 0.1 max parseNumber(ctrlText 120) min 2;
|
||||
} else {
|
||||
_airFriction = parseNumber(ctrlText 120) / -1000;
|
||||
|
@ -15,7 +15,7 @@ if (GVAR(currentUnit) == 1) then
|
||||
{
|
||||
ctrlSetText [ 110, Str(Round((GVAR(workingMemory) select GVAR(currentTarget)) select 12))];
|
||||
};
|
||||
if (EGVAR(advanced_ballistics,AdvancedBallistics) && EGVAR(advanced_ballistics,AdvancedAirDragEnabled)) then {
|
||||
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then {
|
||||
ctrlSetText [ 120, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 15) * 1000) / 1000)];
|
||||
} else {
|
||||
ctrlSetText [ 120, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 4) * -1000 * 1000) / 1000)];
|
||||
|
Loading…
Reference in New Issue
Block a user