From e1a63c2879011311ff99fcf86faa233f239e8dd5 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 30 Apr 2021 15:12:12 +0100 Subject: [PATCH] Items: Correct `UseConsumable` code --- monitor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monitor.py b/monitor.py index 172c6196..6a0b42dd 100644 --- a/monitor.py +++ b/monitor.py @@ -921,12 +921,12 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below # Parameters: # • Name # • Type - for c in self.state['BackPackMaterials']['Consumable']: - if c['Name'] == entry['Name']: - c['Count'] -= 1 + for c in self.state['BackPack']['Consumable']: + if c == entry['Name']: + self.state['BackPack']['Consumable'][c] -= 1 # Paranoia in case we lost track - if i['Count'] < 0: - i['Count'] = 0 + if self.state['BackPack']['Consumable'][c] < 0: + self.state['BackPack']['Consumable'][c] = 0 elif event_type == 'SwitchSuitLoadout': # alpha4