mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Suits: Simplify BuySuit
code.
This commit is contained in:
parent
ac4f052695
commit
203fb051b0
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user