1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 08:40:34 +03:00

eddn: Clear bodyname/id on supercruiseexit, if at orbital station

This commit is contained in:
Athanasius 2022-06-05 15:31:28 +01:00
parent 347e7c6058
commit 52cc71a217
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -1558,7 +1558,19 @@ def journal_entry( # noqa: C901, CCR001
this.odyssey = entry['odyssey'] = state['Odyssey']
# Track location
if event_name in ('location', 'fsdjump', 'docked', 'carrierjump'):
if event_name == 'supercruiseexit':
# For any orbital station we have no way of determining the body
# it orbits:
#
# In-ship Status.json doesn't specify this.
# On-foot Status.json lists the station itself as Body.
# Location for stations (on-foot or in-ship) has station as Body.
# SupercruiseExit (own ship or taxi) lists the station as the Body.
if entry['BodyType'] == 'Station':
this.body_name = None
this.body_id = None
elif event_name in ('location', 'fsdjump', 'docked', 'carrierjump'):
if event_name in ('location', 'carrierjump'):
if entry.get('BodyType') == 'Planet':
this.body_name = entry.get('Body')