1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +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:
Athanasius 2021-10-14 13:04:52 +01:00
parent 2ef9d9e3c3
commit 60f3b524e2
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -804,15 +804,13 @@ 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
entry['BodyID'] = this.body_id
# 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
#######################################################################
msg = {