From 0293eaa423fe4cf691f431d5b5de16f3f978d49e Mon Sep 17 00:00:00 2001 From: Bailey Danyluk Date: Fri, 30 Aug 2024 00:53:56 -0600 Subject: [PATCH] slightly quicker --- .../functions/fnc_seekerType_IR.sqf | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/addons/missileguidance/functions/fnc_seekerType_IR.sqf b/addons/missileguidance/functions/fnc_seekerType_IR.sqf index 7c057cd9e7..46f6a36da2 100644 --- a/addons/missileguidance/functions/fnc_seekerType_IR.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_IR.sqf @@ -62,25 +62,14 @@ if (isNull _trackingTarget) then { } forEach _potentialTargets; }; -if (true || {accTime > 0 && !isGamePaused}) then { +if (accTime > 0 && !isGamePaused) then { // If there are flares nearby, check if they will confuse missile private _nearby = _trackingTarget nearObjects _flareDistanceFilter; _nearby = _nearby select { // 2 = IR blocking - private _blocking = configOf _x >> "weaponLockSystem"; - private _isFlare = false; - if (isNumber _blocking) then { - _isFlare = (2 == getNumber _blocking); - }; - - if (isText _blocking) then { - _isFlare = ("2" in getText _blocking); - }; - - private _withinView = [_projectile, getPosASLVisual _x, _seekerAngle] call FUNC(checkSeekerAngle); - private _canSee = [_projectile, _x, false] call FUNC(checkLos); - - (_x isEqualTo _target && _trackingTarget isNotEqualTo _target) || { (_withinView && _canSee && _isFlare) } + (([getNumber (configOf _x >> "weaponLockSystem"), 4] call EFUNC(common,binarizeNumber)) select 1) && // Check if chaff can break radar lock + {[_projectile, getPosASLVisual _x, _seekerAngle] call FUNC(checkSeekerAngle)} && // Check if within view + {[_projectile, _x, false] call FUNC(checkLos)} // Check if can be seen }; private _frontAspectMultiplier = 1;