From 7434c50ab94a360cb0ba1255298afb62c45885ca Mon Sep 17 00:00:00 2001 From: Nikolai V Chr Date: Mon, 19 Oct 2020 00:40:05 +0200 Subject: [PATCH] Make sure notifications don't stay in the outgoing MP emesary property, which could lead pilots just connecting to MP to get a past notification. --- Nasal/emesary_mp_bridge.nas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Nasal/emesary_mp_bridge.nas b/Nasal/emesary_mp_bridge.nas index b97801e7b..ccc9b1b06 100644 --- a/Nasal/emesary_mp_bridge.nas +++ b/Nasal/emesary_mp_bridge.nas @@ -21,7 +21,7 @@ # Example of connecting an incoming and outgoing bridge (should reside inside an aircraft nasal file) # - # var routedNotifications = [notifications.TacticalNotification.new(nil)]; + # var routedNotifications = [notifications.TacticalNotification.new()]; # var incomingBridge = emesary_mp_bridge.IncomingMPBridge.startMPBridge(routedNotifications); # var outgoingBridge = emesary_mp_bridge.OutgoingMPBridge.new("F-15mp",routedNotifications); #------------------------------------------------------------------ @@ -120,6 +120,8 @@ { if (new_class.TransmitterActive) new_class.Transmit(); + else + new_class.TransmitEnd(); new_class.TransmitTimer.restart(new_class.TransmitFrequencySeconds); }); @@ -237,6 +239,12 @@ me.TransmitterActive = size(me.OutgoingList); setprop(me.MpVariable,outgoing); }; + new_class.TransmitEnd = func + { + if (getprop(me.MpVariable) != "") { + setprop(me.MpVariable,""); + } + }; new_class.Transmitter.Register(new_class); new_class.TransmitTimer.restart(new_class.TransmitFrequencySeconds); return new_class;