summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorraylu <raylu@gridium.com>2013-10-25 00:47:06 -0700
committerraylu <raylu@gridium.com>2013-10-25 00:47:06 -0700
commit4072a99b40a2782092af9efabefa8f6f79d621a9 (patch)
tree36c875f4c75e411a51ef36968e1773611a88ceca /db
parent4fb8abde07e94889ba1acfc86e0b36319c136b97 (diff)
downloadykill-4072a99b40a2782092af9efabefa8f6f79d621a9.tar.xz
fix BPC costs
Diffstat (limited to 'db')
-rw-r--r--db/queries.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/queries.py b/db/queries.py
index b998132..435f4dc 100644
--- a/db/queries.py
+++ b/db/queries.py
@@ -112,13 +112,15 @@ def kill(kill_id):
except db.NoRowsException:
victim['ship_cost'] = 0
+ # 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
FROM items
JOIN item_costs ON item_costs.type_id = items.type_id
JOIN eve.invTypes ON items.type_id = typeID
- WHERE kill_id = ? ORDER BY flag ASC
+ WHERE kill_id = ?
+ ORDER BY (cost * (dropped + destroyed) / (singleton * 499.5 + 1)) DESC
''', kill_id)
items = defaultdict(list)
for item in item_rows: