From 9e74a67e86cce1d7a8cb0519fe075229344ad4f9 Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Wed, 3 Dec 2025 10:15:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=92=D1=8B=D0=BA=D0=BB=D1=8E=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BC=D0=B5=D1=85=D0=B8,=20?= =?UTF-8?q?=D0=B5=D1=81=D0=BB=D0=B8=20=D0=9A=D0=90=D0=9F=D0=A1=20=D0=A0?= =?UTF-8?q?=D0=9F=D0=91=20=D0=BD=D0=B5=20=D0=BD=D0=B0=20=D1=81=D0=B2=D1=8F?= =?UTF-8?q?=D0=B7=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/interfer.gd | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/scripts/interfer.gd b/scripts/interfer.gd index 4dcc22dc..238cf78d 100644 --- a/scripts/interfer.gd +++ b/scripts/interfer.gd @@ -277,10 +277,10 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v var ecm_active = true if not gos_flag: if ecm.nmfs in gos_nmfs: - interfer_off(ecm, unit_instance) + signaller.emit_signal('interfer_off', ecm) ecm_active = false if ecm_active and (prd.fs_caps_id[ecm.nmfs] in fs_closed): - interfer_off(ecm, unit_instance) + signaller.emit_signal('interfer_off', ecm) var th_id = thr.id for ecm_i in thrs.keys(): @@ -290,9 +290,9 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v ecm.kni = fposmod(thr.aoa - course, 360) call_ecm_proc(ecm) if ecm.nmfs in gos_nmfs: - interfer_off(ecm, unit_instance) + signaller.emit_signal('interfer_off', ecm) elif prd.fs_caps_id[ecm.nmfs] in fs_closed: - interfer_off(ecm, unit_instance) + signaller.emit_signal('interfer_off', ecm) else: send_ecm(ecm, unit_instance) signaller.emit_signal('fs_update_color', ecms) @@ -382,7 +382,7 @@ func on_interfer_create(interfer_name, sel_threats, fs_arr, power, u, ecms) -> v for ecm in ecms.values(): if ecm.nmfs == item.nmfs: if item.priority > ecm.priority: - interfer_off(ecm, u) + signaller.emit_signal('interfer_off', ecm) elif item.priority < ecm.priority: need_continue = true break @@ -504,17 +504,17 @@ func send_ecm(ecm, unit0) -> void: unit0.tx_stack.append(json_data) -func on_interfer_off_all(unit0, ecms: Dictionary) -> void: +func on_interfer_off_all(_unit0, ecms: Dictionary) -> void: for ecm in ecms.values(): - interfer_off(ecm, unit0) + signaller.emit_signal('interfer_off', ecm) -func on_threats_lost(th, ecms, unit0) -> void: +func on_threats_lost(th, ecms, _unit0) -> void: for key in interfer.thrs: if interfer.thrs[key] == th.id: var ecm_id = key var ecm = ecms[ecm_id] - interfer_off(ecm, unit0) + signaller.emit_signal('interfer_off', ecm) func pop_id() -> int: @@ -647,13 +647,19 @@ func get_krp(threat: threats.Threat): return krp -func on_interfer_off(ecm: Interfer, _ecms, unit_caps): +func on_interfer_off(ecm: Interfer, ecms, unit_caps): ecm.krp = INTERFER_OFF send_ecm(ecm, unit_caps) - - -func interfer_off(ecm, _unit_caps): - signaller.emit_signal('interfer_off', ecm) + if not unit_caps.online: + var sz = ecms.size() + signaller.emit_signal('on_prog_ecm_off', ecm) + ecms.erase(ecm.ispp) + thrs.erase(ecm.ispp) + cu.erase(ecm.ispp) + fs.erase(ecm.ispp) + push_id(ecm.ispp) + if sz != ecms.size(): + interfer.call_deferred('emit_signal', 'interfer_resized', ecms) func on_interfer_new(ecm, unit_caps):