diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:57:23 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:57:23 +0300 |
| commit | 3533c3aa9393fc6350178b196c813dc636ec9cf6 (patch) | |
| tree | 2f96a879c3935dea18e73410926b03c7eef1a751 /Common/Functions/Common_HandleIncomingMissile.sqf | |
| download | a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.gz a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.bz2 a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.zip | |
init
Diffstat (limited to '')
| -rw-r--r-- | Common/Functions/Common_HandleIncomingMissile.sqf | 22 |
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 |
