1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

Items: Fix DropItems and CollectItems

Tested as actually working.
This commit is contained in:
Athanasius 2021-04-30 15:21:47 +01:00
parent e1a63c2879
commit 60b2045ea4

View File

@ -895,9 +895,9 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
# • Name
# • Type
# • OwnerID
for i in self.state['BackPackMaterials'][entry['Type']]:
if i['Name'] == entry['Name']:
i['Count'] += entry['Count']
for i in self.state['BackPack'][entry['Type']]:
if i == entry['Name']:
self.state['BackPack'][entry['Type']][i] += entry['Count']
elif event_type == 'DropItems':
# alpha4
@ -907,12 +907,12 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
# • OwnerID
# • MissionID
# • Count
for i in self.state['BackPackMaterials'][entry['Type']]:
if i['Name'] == entry['Name']:
i['Count'] -= entry['Count']
for i in self.state['BackPack'][entry['Type']]:
if i == entry['Name']:
self.state['BackPack'][entry['Type']][i] -= entry['Count']
# Paranoia in case we lost track
if i['Count'] < 0:
i['Count'] = 0
if self.state['BackPack'][entry['Type']][i] < 0:
self.state['BackPack'][entry['Type']][i] = 0
elif event_type == 'UseConsumable':
# alpha4