From 96bb0959f53ad520443df23d8b713469a586aabc Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 1 Apr 2021 08:56:35 +0100 Subject: [PATCH] EDDN: Only add missing StarPos if for current system It seems the game can report a Scan event *after* you've jumped to another system. So don't blindly set StarPos on Scan, check the SystemAddress against where we think we are first. --- plugins/eddn.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/eddn.py b/plugins/eddn.py index be29284c..464eae46 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -714,6 +714,12 @@ def journal_entry( # noqa: C901 logger.warning("this.coordinates is None, can't add StarPos") return "this.coordinates is None, can't add StarPos" + # Gazelle[TD] reported seeing a lagged Scan event with incorrect + # augmented StarPos: + if this.systemaddress is None or this.systemaddress != entry['SystemAddress']: + logger.warning("event has no StarPos, but SystemAddress isn't current location") + return "Wrong System! Delayed Scan event?" + entry['StarPos'] = list(this.coordinates) if 'SystemAddress' not in entry: