From 203fb051b09c9762707f140f2cc768b1a5f2c4f4 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 30 Apr 2021 10:47:09 +0100 Subject: [PATCH] Suits: Simplify `BuySuit` code. --- monitor.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/monitor.py b/monitor.py index bea4ab00..92522bfe 100644 --- a/monitor.py +++ b/monitor.py @@ -1012,20 +1012,13 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below # alpha4 : # { "timestamp":"2021-04-29T09:03:37Z", "event":"BuySuit", "Name":"UtilitySuit_Class1", # "Name_Localised":"Maverick Suit", "Price":150000, "SuitID":1698364934364699 } - new_suit = { + self.state['Suits'][entry['SuitID']] = { 'name': entry['Name'], 'locName': entry.get('Name_Localised', entry['Name']), 'id': None, # Is this an FDev ID for suit type ? 'suitId': entry['SuitID'], 'slots': [], } - if self.state['Suits'] is None: - self.state['Suits'] = {entry['SuitID']: new_suit} - - else: - self.state['Suits'].update( - {entry['SuitID']: new_suit} - ) # update credits self.state['Credits'] -= entry.get('Price', 0)