mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 18:07:37 +03:00
EDDN: codexentry: Always set BodyName from Status.json, ID if Journal matches
Partial data is better than no data, or bad data. So if Status.json BodyName is available, always use it. *Then* see if Journal BodyName matches that, and if so set BodyID. Close-orbiting bodies might therefore cause BodyName to be set without BodyID, but then it's up to EDDN listeners to make a decision, rather than making it for them.
This commit is contained in:
parent
2ef9d9e3c3
commit
60f3b524e2
@ -804,14 +804,12 @@ Msg:\n{msg}'''
|
||||
|
||||
entry = ret
|
||||
|
||||
# Body Name and ID, if available
|
||||
# Status.json BodyName is set as soon as the Orbital Cruise/Glide HUD
|
||||
# activates.
|
||||
# Journal ApproachBody only occurs once inside Orbital Cruise altitude.
|
||||
# So we check that both are set, and match, then use the Status.json
|
||||
# value.
|
||||
if this.status_body_name is not None and this.status_body_name == this.body_name:
|
||||
# Set BodyName if it's available from Status.json
|
||||
if this.status_body_name is not None:
|
||||
entry['BodyName'] = this.status_body_name
|
||||
# Only set BodyID if journal BodyName matches the Status.json one.
|
||||
# This avoids binary body issues.
|
||||
if this.status_body_name == this.body_name:
|
||||
entry['BodyID'] = this.body_id
|
||||
#######################################################################
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user