From b053a641d9ca58d4e048b7a458253ad7dd03db99 Mon Sep 17 00:00:00 2001 From: ulteq Date: Sat, 25 Apr 2015 13:15:54 +0200 Subject: [PATCH] Improved bullet trace visibility check --- .../functions/fnc_handleFired.sqf | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index 3741254267..8d8d77a812 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -79,10 +79,16 @@ if (GVAR(ammoTemperatureEnabled)) then { }; _bulletTraceVisible = false; -if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER" && currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { - _opticsName = (primaryWeaponItems ACE_player) select 2; - _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); - _bulletTraceVisible = (_opticType == 2 || currentWeapon ACE_player in ["ACE_Vector", "Binocular", "Rangefinder", "Laserdesignator"]); +if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { + if (currentWeapon ACE_player in ["ACE_Vector", "Binocular", "Rangefinder", "Laserdesignator"]) then { + _bulletTraceVisible = true; + } else { + if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { + _opticsName = (primaryWeaponItems ACE_player) select 2; + _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + _bulletTraceVisible = _opticType == 2; + }; + }; }; _caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_caliber");