From 09c81a21f684ee8df55a566af931a501a4ec2c97 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 10 Jun 2021 12:34:30 +0100 Subject: [PATCH] ShipLocker: do *NOT* zero out BackPack when handling this event Just need to ensure we do on Embark (or Death? but likely fresh events then anyway?). Certainly if Journal event order is ever Backpack *then* ShipLocker this would erroneously zero out the backpack. --- monitor.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/monitor.py b/monitor.py index 8deaa5b3..4f7ebce9 100644 --- a/monitor.py +++ b/monitor.py @@ -863,15 +863,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below self.state['Consumable'] = defaultdict(int) self.state['Item'] = defaultdict(int) self.state['Data'] = defaultdict(int) - # TODO: Really we need a full BackPackMaterials event at the same time. - # In lieu of that, empty the backpack. This will explicitly - # be wrong if Cmdr relogs at a Settlement with anything in - # backpack. - # Still no BackPackMaterials at the same time in 4.0.0.31 - self.state['BackPack']['Component'] = defaultdict(int) - self.state['BackPack']['Consumable'] = defaultdict(int) - self.state['BackPack']['Item'] = defaultdict(int) - self.state['BackPack']['Data'] = defaultdict(int) + + # 4.0.0.400 - No longer zeroing out the BackPack in this event, + # as we should now always get either `Backpack` event/file or + # `BackpackChange` as needed. clean_components = self.coalesce_cargo(entry['Components']) self.state['Component'].update(