From 4baa2490af890e024c9c1c5eac301ba2550b838a Mon Sep 17 00:00:00 2001
From: Athanasius <github@miggy.org>
Date: Sun, 29 May 2022 15:00:19 +0100
Subject: [PATCH] eddn: fssallbodiesfound: Location cross-check paranoia

---
 plugins/eddn.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plugins/eddn.py b/plugins/eddn.py
index d39c6c60..464045b3 100644
--- a/plugins/eddn.py
+++ b/plugins/eddn.py
@@ -1207,7 +1207,12 @@ class EDDN:
         #######################################################################
         # Augmentations
         #######################################################################
-        # In this case should add StarSystem and StarPos
+        # In this case should add StarPos, but only if the
+        # SystemAddress of where we think we are matches.
+        if this.systemaddress is None or this.systemaddress != entry['SystemAddress']:
+            logger.warning("SystemAddress isn't current location! Can't add augmentations!")
+            return 'Wrong System! Missed jump ?'
+
         ret = this.eddn.entry_augment_system_data(entry, system_name, system_starpos)
         if isinstance(ret, str):
             return ret