From 386ea1636e7943c4e1bbec9f28102a5d5bc20424 Mon Sep 17 00:00:00 2001
From: Athanasius <Athanasius@miggy.org>
Date: Mon, 9 Jan 2023 11:26:35 +0000
Subject: [PATCH] eddn: For 'docked' only set entry Body(Type) if latter is
 'Planet'

We explicitly must not set this for other BodyType, e.g. 'Station'.
---
 plugins/eddn.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/eddn.py b/plugins/eddn.py
index 5366f73e..0a20bdfc 100644
--- a/plugins/eddn.py
+++ b/plugins/eddn.py
@@ -2323,10 +2323,10 @@ def journal_entry(  # noqa: C901, CCR001
             ]
 
         # add planet to Docked event for planetary stations if known
-        if event_name == 'docked' and this.body_name:
-            # FIXME - Is this correct if using monitor.py tracking ?
-            entry['Body'] = this.body_name
-            entry['BodyType'] = 'Planet'
+        if event_name == 'docked' and state['Body'] is not None:
+            if state['BodyType'] == 'Planet':
+                entry['Body'] = state['Body']
+                entry['BodyType'] = state['BodyType']
 
         # The generic journal schema is for events:
         #   Docked, FSDJump, Scan, Location, SAASignalsFound, CarrierJump