Variable for repeated locality check

This commit is contained in:
mrschick 2024-08-23 15:22:23 +02:00
parent 34e7a70fdf
commit 50da8341cd

View File

@ -27,7 +27,9 @@ if (GVAR(simplifiedZeroing)) exitWith {
((_adjustment select _weaponIndex) select 0) ((_adjustment select _weaponIndex) select 0)
}; };
private _optic = if (_unit == ACE_Player) then { private _local = (_unit == ACE_Player);
private _optic = if (_local) then {
GVAR(Optics) select _weaponIndex; GVAR(Optics) select _weaponIndex;
} else { } else {
([_unit] call FUNC(getOptics)) select _weaponIndex; ([_unit] call FUNC(getOptics)) select _weaponIndex;
@ -35,7 +37,7 @@ private _optic = if (_unit == ACE_Player) then {
private _opticConfig = if (_optic != "") then { private _opticConfig = if (_optic != "") then {
(configFile >> "CfgWeapons" >> _optic) (configFile >> "CfgWeapons" >> _optic)
} else { } else {
if (_unit == ACE_Player) then { if (_local) then {
(configFile >> "CfgWeapons" >> (GVAR(Guns) select _weaponIndex)) (configFile >> "CfgWeapons" >> (GVAR(Guns) select _weaponIndex))
} else { } else {
private _gun = switch (_weaponIndex) do { private _gun = switch (_weaponIndex) do {