diff options
author | raylu <raylu@gridium.com> | 2013-10-25 02:50:49 -0700 |
---|---|---|
committer | raylu <raylu@gridium.com> | 2013-10-25 02:50:49 -0700 |
commit | add49f431049363efc7fb918cfd4a85bb1ac6873 (patch) | |
tree | a529f565e50a28d57daddcf2eb557ca621d8d055 /db/queries.py | |
parent | b2de2ff8f704a0fbbbd25c9b76e14b36107895f0 (diff) | |
download | ykill-master.tar.xz |
Diffstat (limited to 'db/queries.py')
-rw-r--r-- | db/queries.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/db/queries.py b/db/queries.py index 435f4dc..45bbe1d 100644 --- a/db/queries.py +++ b/db/queries.py @@ -115,7 +115,7 @@ def kill(kill_id): # see update_costs for an explanation of the ORDER BY item_rows = db.query(c, ''' SELECT items.type_id, flag, dropped, destroyed, singleton, - cost, typeName AS item_name, capacity + cost, typeName AS item_name FROM items JOIN item_costs ON item_costs.type_id = items.type_id JOIN eve.invTypes ON items.type_id = typeID @@ -151,6 +151,21 @@ def kill(kill_id): slot = '???' items[slot].append(item) + module_slots = ['high', 'medium', 'low'] + fitting_items = set() + for slot in module_slots: + fitting_items.update(map(operator.itemgetter('type_id'), items[slot])) + # 11: requires low, 12: requires high, 13: requires medium; :CCP: + modules = db.query(c, ''' + SELECT DISTINCT typeID AS type_id FROM eve.dgmTypeEffects + WHERE typeID IN ({}) and effectID IN (11, 12, 13) + '''.format(','.join(map(str, fitting_items)))) + module_ids = set(map(operator.itemgetter('type_id'), modules)) + for slot in module_slots: + for item in items[slot]: + if item['type_id'] not in module_ids: + item['charge'] = True + slot_rows = db.query(c, ''' SELECT attributeID, valueInt, valueFloat FROM eve.dgmTypeAttributes WHERE typeID = ? AND attributeID IN (12, 13, 14, 1137, 1367) |