Skip to content

Commit

Permalink
xm157 conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Jan 19, 2024
1 parent 532b193 commit 8b73ceb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions addons/xm157/functions/fnc_ballistics_calculator.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private _gravity = [-sin (_bank) * cos(_scopeBaseAngle + _inclinationAngle) * -G

private _useAB = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false];
if (_useAB) then {
_bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel]));
_bc = parseNumber (("ace" callExtension ["ballistics:atmospheric_correction", [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel]]) select 0);
};

private _deltaT = 1 / 60;
Expand All @@ -58,7 +58,7 @@ while {(_TOF < 5) && {(_bulletPos # 1) < _targetRange}} do {
private _trueSpeed = vectorMagnitude _trueVelocity;

private _bulletAccel = if (_useAB) then {
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature]));
private _drag = parseNumber (("ace" callExtension ["ballistics:retard", [_dragModel, _bc, _trueSpeed, _temperature]]) select 0);
(vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag);
} else {
_trueVelocity vectorMultiply (_trueSpeed * _airFriction);
Expand Down
3 changes: 1 addition & 2 deletions addons/xm157/functions/fnc_ballistics_getData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ if ((_weaponInfo isEqualTo []) && {_magazineClass != ""}) then {
};

// Scope Base Angle
private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight];
private _scopeBaseAngle = parseNumber _zeroAngle;
private _scopeBaseAngle = parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_zeroRange, _muzzleVelocity, _airFriction, _boreHeight]]) select 0);

_weaponInfo = [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,_bc,_dragModel,_atmosphereModel,_barrelTwist,_twistDirection,_caliber,_bulletLength,_bulletMass];
GVAR(data) set [_key, _weaponInfo];
Expand Down

0 comments on commit 8b73ceb

Please sign in to comment.