Fix GVAR(Guns) locality issue

This commit is contained in:
mrschick 2024-08-23 15:20:07 +02:00
parent 17bea4bee8
commit 34e7a70fdf

View File

@ -35,7 +35,16 @@ private _optic = if (_unit == ACE_Player) then {
private _opticConfig = if (_optic != "") then {
(configFile >> "CfgWeapons" >> _optic)
} else {
(configFile >> "CfgWeapons" >> (GVAR(Guns) select _weaponIndex))
if (_unit == ACE_Player) then {
(configFile >> "CfgWeapons" >> (GVAR(Guns) select _weaponIndex))
} else {
private _gun = switch (_weaponIndex) do {
case 1: { secondaryWeapon _unit };
case 2: { handgunWeapon _unit };
default { primaryWeapon _unit };
};
(configFile >> "CfgWeapons" >> _gun)
};
};
private _zeroRange = currentZeroing _unit;