diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
| commit | 68d4c9bbd80ed2e6528244569c79676b87295bd1 (patch) | |
| tree | 6efd42fbf6f1281874ae0ff1f8816b01fe0c7153 /Common/Functions/Common_HandleIncomingMissile.sqf | |
| download | a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.gz a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.bz2 a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.zip | |
init
Diffstat (limited to 'Common/Functions/Common_HandleIncomingMissile.sqf')
| -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 |
