From 2f2ee885c8a4fae17403ca2ee1cd65e25c1d2386 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 16 Jan 2023 19:30:02 +0000 Subject: [PATCH] monitor/tracking: *Do* clear supercruisentry/body state if Station type --- monitor.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/monitor.py b/monitor.py index c65aef5c..bd82fe8e 100644 --- a/monitor.py +++ b/monitor.py @@ -1000,9 +1000,13 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below self.state['BodyType'] = None elif event_type == 'supercruiseentry': - # NB: Do **NOT** clear Body state, because we won't get a fresh - # ApproachBody if we don't leave Orbital Cruise but land - # again. + # We only clear Body state if the Type is Station. This is + # because we won't get a fresh ApproachBody if we don't leave + # Orbital Cruise but land again. + if self.state['BodyType'] == 'Station': + self.state['Body'] = None + self.state['BodyID'] = None + self.state['BodyType'] = None ############################################################### # Track: Current station, if applicable