From 47497692d0231a7f2ee96ad63afdc5088d83208c Mon Sep 17 00:00:00 2001 From: "Nikolai V. Chr" Date: Fri, 22 Sep 2023 02:52:36 +0200 Subject: [PATCH] Stores: Revert adding AGM-154A to be droppable by CCRP and CCIP. Commit 28e6cb71844903ff217179ae1f2023e8235e3c72 --- Nasal/HUD/HUD_main.nas | 12 ++++++++++-- Nasal/fire-control.nas | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Nasal/HUD/HUD_main.nas b/Nasal/HUD/HUD_main.nas index 820310e5..191d4e4a 100644 --- a/Nasal/HUD/HUD_main.nas +++ b/Nasal/HUD/HUD_main.nas @@ -3030,7 +3030,7 @@ append(obj.total, obj.speed_curr); } var selW = pylons.fcs.getSelectedWeapon(); if (selW != nil and !hdp.CCIP_active and - (selW.type=="MK-82" or selW.type=="MK-82AIR" or selW.type=="MK-83" or selW.type=="MK-84" or selW.type=="GBU-12" or selW.type=="GBU-31" or selW.type=="GBU-54" or selW.type=="GBU-24" or selW.type=="CBU-87" or selW.type=="CBU-105" or selW.type=="AGM-154A" or selW.type=="B61-7" or selW.type=="B61-12") and selW.status == armament.MISSILE_LOCK ) { + (me.containsVector(fc.CCIP_CCRP, selW.type) and selW.status == armament.MISSILE_LOCK ) { if (selW.guidance == "unguided") { me.dt = 0.1; @@ -3096,7 +3096,7 @@ append(obj.total, obj.speed_curr); if(hdp.CCIP_active) { if (hdp.fcs_available and hdp.getproper("master_arm") != 0) { var selW = pylons.fcs.getSelectedWeapon(); - if (selW != nil and (selW.type=="MK-82" or selW.type=="MK-82AIR" or selW.type=="MK-83" or selW.type=="MK-84" or selW.type=="GBU-12" or selW.type=="GBU-31" or selW.type=="GBU-54" or selW.type=="GBU-24" or selW.type=="CBU-87" or selW.type=="CBU-105" or selW.type=="B61-7" or selW.type=="B61-12")) { + if (selW != nil and me.containsVector(fc.CCIP_CCRP, selW.type)) { me.showmeCCIP = 1; me.ccipPos = pylons.fcs.getSelectedWeapon().getCCIPadv(18,0.20); if (me.ccipPos == nil) { @@ -3438,6 +3438,14 @@ append(obj.total, obj.speed_curr); } } }, + containsVector: func (vec, item) { + foreach(test; vec) { + if (test == item) { + return 1; + } + } + return 0; + }, extrapolate: func (x, x1, x2, y1, y2) { return y1 + ((x - x1) / (x2 - x1)) * (y2 - y1); }, diff --git a/Nasal/fire-control.nas b/Nasal/fire-control.nas index 0a22da4a..c83a8f9b 100644 --- a/Nasal/fire-control.nas +++ b/Nasal/fire-control.nas @@ -1285,9 +1285,12 @@ var printfDebug = func {if (debug == 1) call(printf,arg);}; -# This is non-generic methods, please edit it to fit your radar setup: +# This is non-generic methods, please edit it to fit your radar/weapon setup: + +# List of weapons that can be CCIP/CCRP dropped: +var CCIP_CCRP = ["MK-82","MK-82AIR","MK-83","MK-84","GBU-12","GBU-24","GBU-54","CBU-87","CBU-105","GBU-31","B61-7","B61-12"]; # List of weapons that can be ripple/dual dropped: -var dualWeapons = ["MK-82","MK-82AIR","MK-83","MK-84","GBU-12","GBU-24","GBU-54","CBU-87","CBU-105","GBU-31","AGM-154A","B61-7","B61-12"]; +var dualWeapons = ["MK-82","MK-82AIR","MK-83","MK-84","GBU-12","GBU-24","GBU-54","CBU-87","CBU-105","GBU-31","B61-7","B61-12","AGM-154A"]; var defaultCannon = "20mm Cannon"; var defaultRocket = "LAU-68"; var getCompleteRadarTargetsList = func {