Fix 'ACE_ScopeZeroRange' setting being ignored when placed in weapon classes

* Only relevant for weapons with integrated scopes
This commit is contained in:
ulteq 2016-11-16 12:25:21 +01:00 committed by ulteq
parent 1f364da0df
commit 273e603cad

View File

@ -23,11 +23,14 @@ private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponI
if (_weaponIndex < 0) exitWith { currentZeroing _unit };
private _optic = GVAR(Optics) select _weaponIndex;
private _opticConfig = configFile >> "CfgWeapons" >> _optic;
private _opticType = getNumber(_opticConfig >> "ItemInfo" >> "opticType");
private _opticConfig = if (_optic != "") then {
(configFile >> "CfgWeapons" >> _optic)
} else {
(configFile >> "CfgWeapons" >> (GVAR(Guns) select _weaponIndex))
};
private _zeroRange = currentZeroing _unit;
if (_opticType == 2 && {(GVAR(canAdjustElevation) select _weaponIndex) || GVAR(forceUseOfAdjustmentTurrets)}) then {
if (GVAR(canAdjustElevation) select _weaponIndex) then {
_zeroRange = GVAR(defaultZeroRange);
};
if (isNumber (_opticConfig >> "ACE_ScopeZeroRange")) then {