From 5f59487a7ba16e77e1e17f040b45bc7c6108e33e Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 5 Apr 2021 15:46:03 +0100 Subject: [PATCH] Zero out BackPack Materials on ShipLockerMaterials This at least ensures we're correct after logging back in at a station. If you relog whilst out at a Settlement then counts will definitely be wrong now. But there are no events for using consumables, or picking anything up anyway, so it's almost always going to be off there. --- monitor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monitor.py b/monitor.py index 34036d3a..230794b1 100644 --- a/monitor.py +++ b/monitor.py @@ -717,6 +717,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below self.state['Component'] = defaultdict(int) self.state['Consumable'] = defaultdict(int) self.state['Item'] = defaultdict(int) + # TODO: Assume backpack is empty? + self.state['BackPack']['Component'] = defaultdict(int) + self.state['BackPack']['Consumable'] = defaultdict(int) + self.state['BackPack']['Item'] = defaultdict(int) clean_components = self.coalesce_cargo(entry['Components']) self.state['Component'].update(