AB/Scopes - Fix script errors on profiling branch (#9869)

* AB/Scopes - Fix script errors on profiling branch

* Update addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
This commit is contained in:
PabstMirror 2024-03-24 11:32:28 -05:00 committed by GitHub
parent 58f6430bb6
commit 86f1b6b142
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 7 deletions

View File

@ -44,6 +44,9 @@ if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
_dragModel = 1;
};
private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients");
if (_ballisticCoefficients isEqualTo []) then {
_ballisticCoefficients = [0.5];
};
private _velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries");
private _atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere");
if (_atmosphereModel isEqualTo "") then {

View File

@ -4,24 +4,28 @@
* Calculates the zero angle correction for the new zero range based on current zero range and bore height (distance between bore- and sight axis)
*
* Arguments:
* 0: Zero range <NUMBER>
* 1: Bore height <NUMBER>
* 2: Weapon <OBJECT>
* 3: Ammo <CLASS>
* 4: Magazine <CLASS>
* 5: Advanced Ballistics enabled? <BOOL>
* 0: Old Zero range <NUMBER>
* 1: New Zero range <NUMBER>
* 2: Bore height <NUMBER>
* 3: Weapon <OBJECT>
* 4: Ammo <STRING>
* 5: Magazine <STRING>
* 6: Advanced Ballistics enabled? <BOOL>
*
* Return Value:
* zeroAngleCorrection <NUMBER>
*
* Example:
* [5, 6, gun, ammo, magazine, true] call ace_scopes_fnc_calculateZeroAngleCorrection
* [5, 6, 7, gun, ammo, magazine, true] call ace_scopes_fnc_calculateZeroAngleCorrection
*
* Public: No
*/
params ["_oldZeroRange", "_newZeroRange", "_boreHeight"/*in cm*/, "_weapon", "_ammo", "_magazine", "_advancedBallistics"];
// When FFV from vehicles currentZeroing will report 0 so just bail
if (_oldZeroRange <= 0) exitWith { 0 };
private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction");
private _initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
private _initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed");