summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorraylu <raylu@gridium.com>2013-10-25 02:50:49 -0700
committerraylu <raylu@gridium.com>2013-10-25 02:50:49 -0700
commitadd49f431049363efc7fb918cfd4a85bb1ac6873 (patch)
treea529f565e50a28d57daddcf2eb557ca621d8d055 /db
parentb2de2ff8f704a0fbbbd25c9b76e14b36107895f0 (diff)
downloadykill-master.tar.xz
why do cap booster charges have capacity?HEADmaster
Diffstat (limited to 'db')
-rw-r--r--db/queries.py17
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)