Scopes - Add 'DISABLE_DISPERSION' helper flag

* Allows you to disable vanilla dispersion for testing purposes by defining 'DISABLE_DISPERSION'
This commit is contained in:
ulteq 2017-11-21 23:56:46 +01:00
parent 91425f8576
commit ce825ce8d3
3 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,10 @@ if (_initSpeedCoef < 0) then {
private _zeroAngle = "ace_advanced_ballistics" callExtension format ["replicateVanillaZero:%1:%2:%3", _oldZeroRange, _initSpeed, _airFriction];
private _vanillaZero = parseNumber _zeroAngle;
#ifdef DISABLE_DISPERSION
_vanillaZero = 0;
#endif
private _trueZero = if (!_advancedBallistics) then {
_zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _newZeroRange, _initSpeed, _airFriction, _boreHeight];
(parseNumber _zeroAngle)

View File

@ -41,6 +41,9 @@ if (GVAR(correctZeroing)) then {
_zeroCorrection = [_oldZeroRange, _newZeroRange, _boreHeight, _weapon, _ammo, _magazine, _advancedBallistics] call FUNC(calculateZeroAngleCorrection);
};
_zeroing = _zeroing vectorAdd [0, 0, _zeroCorrection - _baseAngle];
#ifdef DISABLE_DISPERSION
_projectile setVelocity (_unit weaponDirection currentWeapon _unit) vectorMultiply (vectorMagnitude (velocity _projectile));
#endif
};
if (_zeroing isEqualTo [0, 0, 0]) exitWith {};

View File

@ -16,6 +16,8 @@
#define DEFAULT_RAIL_BASE_ANGLE 0.0086
// #define DISABLE_DISPERSION
#ifdef DEBUG_ENABLED_SCOPES
#define DEBUG_MODE_FULL
#endif