summaryrefslogtreecommitdiffstats
path: root/Common/Functions/Common_HandleIncomingMissile.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
commita3a91d4f45b22fd487ecbc954ad979be5d03efdd (patch)
treea554ab159a347dcd6c00ca1c7c26c1ec3ac0a6bd /Common/Functions/Common_HandleIncomingMissile.sqf
downloada2wf_chernarus-main.tar.gz
a2wf_chernarus-main.tar.bz2
a2wf_chernarus-main.zip
Diffstat (limited to '')
-rw-r--r--Common/Functions/Common_HandleIncomingMissile.sqf22
1 files changed, 22 insertions, 0 deletions
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