mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Bugfix - Fixes ace_scopes affecting under-barrel grenade launchers
This commit is contained in:
@ -15,6 +15,8 @@
|
|||||||
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
||||||
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
|
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
|
||||||
|
|
||||||
|
if (!(_ammo isKindOf "BulletBase")) exitWith {};
|
||||||
|
|
||||||
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
|
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
|
||||||
if (_weaponIndex < 0) exitWith {};
|
if (_weaponIndex < 0) exitWith {};
|
||||||
|
|
||||||
@ -25,17 +27,15 @@ TRACE_1("Adjusting With",_zeroing);
|
|||||||
// Convert zeroing from mils to degrees
|
// Convert zeroing from mils to degrees
|
||||||
_zeroing = _zeroing vectorMultiply 0.05625;
|
_zeroing = _zeroing vectorMultiply 0.05625;
|
||||||
|
|
||||||
if (_ammo isKindOf "BulletBase") then {
|
private _advancedBallistics = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false];
|
||||||
private _advancedBallistics = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false];
|
private _boreHeight = GVAR(boreHeight) select _weaponIndex;
|
||||||
private _boreHeight = GVAR(boreHeight) select _weaponIndex;
|
private _oldZeroRange = currentZeroing _unit;
|
||||||
private _oldZeroRange = currentZeroing _unit;
|
private _newZeroRange = [_unit] call FUNC(getCurrentZeroRange);
|
||||||
private _newZeroRange = [_unit] call FUNC(getCurrentZeroRange);
|
private _zeroCorrection = missionNamespace getVariable format[QGVAR(%1_%2_%3_%4_%5_%6_%7), _oldZeroRange, _newZeroRange, _boreHeight, _weapon, _ammo, _magazine, _advancedBallistics];
|
||||||
private _zeroCorrection = missionNamespace getVariable format[QGVAR(%1_%2_%3_%4_%5_%6_%7), _oldZeroRange, _newZeroRange, _boreHeight, _weapon, _ammo, _magazine, _advancedBallistics];
|
if (isNil "_zeroCorrection") then {
|
||||||
if (isNil "_zeroCorrection") then {
|
_zeroCorrection = [_oldZeroRange, _newZeroRange, _boreHeight, _weapon, _ammo, _magazine, _advancedBallistics] call FUNC(calculateZeroAngleCorrection);
|
||||||
_zeroCorrection = [_oldZeroRange, _newZeroRange, _boreHeight, _weapon, _ammo, _magazine, _advancedBallistics] call FUNC(calculateZeroAngleCorrection);
|
|
||||||
};
|
|
||||||
_zeroing = _zeroing vectorAdd [0, 0, _zeroCorrection];
|
|
||||||
};
|
};
|
||||||
|
_zeroing = _zeroing vectorAdd [0, 0, _zeroCorrection];
|
||||||
|
|
||||||
if (_zeroing isEqualTo [0, 0, 0]) exitWith {};
|
if (_zeroing isEqualTo [0, 0, 0]) exitWith {};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user