1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-19 18:37:39 +03:00

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.
This commit is contained in:
Athanasius 2021-04-05 15:46:03 +01:00
parent 9609286ff4
commit 5f59487a7b

View File

@ -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(