From e670b4ed55c459a21090bd0178ceaaaf12d87989 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:58:31 +0300 Subject: init --- Common/Functions/Common_HandleIncomingMissile.sqf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Common/Functions/Common_HandleIncomingMissile.sqf (limited to 'Common/Functions/Common_HandleIncomingMissile.sqf') diff --git a/Common/Functions/Common_HandleIncomingMissile.sqf b/Common/Functions/Common_HandleIncomingMissile.sqf new file mode 100644 index 0000000..8318f4c --- /dev/null +++ b/Common/Functions/Common_HandleIncomingMissile.sqf @@ -0,0 +1,22 @@ +Private ["_ammo","_irLock","_missile","_source","_unit"]; +_unit = _this select 0; +_ammo = _this select 1; +_source = _this select 2; + +_missile = nearestObject [_source,_ammo]; +if (isNull _missile) exitWith {}; + +//--- Get the ammo type. +_irLock = getNumber(configFile >> "CfgAmmo" >> _ammo >> "irLock"); + +//--- IR Lock is affected +if (_irLock == 1) then { + _distance = _unit distance _source; + + _limit = 'WFBE_INCOMINGMISSILEMAXRANGE' Call GetNamespace; + + if (_distance > _limit) then { + waitUntil {_missile distance _source > _limit}; + deleteVehicle _missile; + }; +}; \ No newline at end of file -- cgit v1.3.1