1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-18 18:07:37 +03:00

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.
This commit is contained in:
Athanasius 2021-05-12 10:56:43 +01:00
parent b3495df1b6
commit 7f45953012
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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