Scopes - Fixed bugs in the zero angle calculation (#5742)

* Fixed typo in the module setting parsing (reference temperature was way off)
* Fixed bug in the zero angle calculator (muzzle velocity was off in most cases)
This commit is contained in:
ulteq 2017-11-11 14:15:59 +01:00 committed by GitHub
parent 6edfe4375b
commit 9ea1f6839f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -57,6 +57,11 @@ private _trueZero = if (!_advancedBallistics) then {
_initSpeed = _initSpeed + _barrelVelocityShift; _initSpeed = _initSpeed + _barrelVelocityShift;
}; };
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,ammoTemperatureEnabled), false]) then {
private _ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, GVAR(zeroReferenceTemperature)] call EFUNC(advanced_ballistics,calculateAmmoTemperatureVelocityShift));
_initSpeed = _initSpeed + _ammoTemperatureVelocityShift;
};
_zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngle:%1:%2:%3:%4:%5:%6:%7:%8:%9", _newZeroRange, _initSpeed, _boreHeight, GVAR(zeroReferenceTemperature), GVAR(zeroReferenceBarometricPressure), GVAR(zeroReferenceHumidity), _ballisticCoefficients select 0, _dragModel, _atmosphereModel]; _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngle:%1:%2:%3:%4:%5:%6:%7:%8:%9", _newZeroRange, _initSpeed, _boreHeight, GVAR(zeroReferenceTemperature), GVAR(zeroReferenceBarometricPressure), GVAR(zeroReferenceHumidity), _ballisticCoefficients select 0, _dragModel, _atmosphereModel];
(parseNumber _zeroAngle) (parseNumber _zeroAngle)
}; };

View File

@ -32,6 +32,6 @@ if !(_activated) exitWith {};
[_logic, QGVAR(deduceBarometricPressureFromTerrainAltitude), "deduceBarometricPressureFromTerrainAltitude"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(deduceBarometricPressureFromTerrainAltitude), "deduceBarometricPressureFromTerrainAltitude"] call EFUNC(common,readSettingFromModule);
GVAR(defaultZeroRange) = 0 max GVAR(defaultZeroRange) min 1000; GVAR(defaultZeroRange) = 0 max GVAR(defaultZeroRange) min 1000;
GVAR(zeroReferenceTemperature) = -55 max GVAR(zeroReferenceTemperature) max 55; GVAR(zeroReferenceTemperature) = -55 max GVAR(zeroReferenceTemperature) min 55;
GVAR(zeroReferenceBarometricPressure) = 0 max GVAR(zeroReferenceBarometricPressure) min 1013.25; GVAR(zeroReferenceBarometricPressure) = 0 max GVAR(zeroReferenceBarometricPressure) min 1013.25;
GVAR(zeroReferenceHumidity) = 0 max GVAR(zeroReferenceHumidity) min 1.0; GVAR(zeroReferenceHumidity) = 0 max GVAR(zeroReferenceHumidity) min 1.0;