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 committed 2021-05-12 10:56:43 +01:00
1 parent b3495df1b6
commit 7f45953012
3 files changed
+4 -4

No files matched your search

+1 -1
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
+2 -2
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
+1 -1
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