From 7f45953012f32cfb392be1a619e005fe4e3a17dd Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 12 May 2021 10:56:43 +0100 Subject: [PATCH] plugins/station: *Do* set station from BodyType/Body always The 'if not this.station' was early paranoia when first getting things working with Odyssey. It prevents a relog from Horizons (i.e. different location) from correctly picking up an Odyssey login station when on-foot in concourse. Also, EDSM was defaulting wrongly for this.station_marketid. Not that the plugin even *uses* that at this time. --- plugins/eddb.py | 2 +- plugins/edsm.py | 4 ++-- plugins/inara.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/eddb.py b/plugins/eddb.py index e5e9f81c..cd51b49c 100644 --- a/plugins/eddb.py +++ b/plugins/eddb.py @@ -118,7 +118,7 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): this.station = entry.get('StationName') or this.station # on_foot station detection - if not this.station and entry['event'] == 'Location' and entry['BodyType'] == 'Station': + if entry['event'] == 'Location' and entry['BodyType'] == 'Station': this.station = entry['Body'] this.station_marketid = entry.get('MarketID') or this.station_marketid diff --git a/plugins/edsm.py b/plugins/edsm.py index f4118f56..43a3c8ff 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -373,10 +373,10 @@ def journal_entry( this.station = entry.get('StationName', this.station) # on_foot station detection - if not this.station and entry['event'] == 'Location' and entry['BodyType'] == 'Station': + if entry['event'] == 'Location' and entry['BodyType'] == 'Station': this.station = entry['Body'] - this.station_marketid = entry.get('MarketID', this.station) + this.station_marketid = entry.get('MarketID', this.station_marketid) # We might pick up StationName in DockingRequested, make sure we clear it if leaving if entry['event'] in ('Undocked', 'FSDJump', 'SupercruiseEntry'): this.station = None diff --git a/plugins/inara.py b/plugins/inara.py index c8110ff0..4f76b603 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -386,7 +386,7 @@ def journal_entry( # noqa: C901, CCR001 this.station = entry.get('StationName', this.station) # on_foot station detection - if not this.station and entry['event'] == 'Location' and entry['BodyType'] == 'Station': + if entry['event'] == 'Location' and entry['BodyType'] == 'Station': this.station = entry['Body'] this.station_marketid = entry.get('MarketID', this.station_marketid) or this.station_marketid