diff options
author | raylu <raylu@gridium.com> | 2013-10-21 21:41:05 -0700 |
---|---|---|
committer | raylu <raylu@gridium.com> | 2013-10-21 21:41:05 -0700 |
commit | 5849a1738cf4fb36b1b6b5c9a22c516c132088d5 (patch) | |
tree | b571706a18185ea0722b2f5b57912c1daa3c5a66 /db | |
parent | 9ae6920c507c4ad580d2557e1d826cff62c418aa (diff) | |
download | ykill-5849a1738cf4fb36b1b6b5c9a22c516c132088d5.tar.xz |
support old ship's slots
Diffstat (limited to 'db')
-rw-r--r-- | db/queries.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/db/queries.py b/db/queries.py index df64526..5da3262 100644 --- a/db/queries.py +++ b/db/queries.py @@ -109,14 +109,15 @@ def kill(kill_id): items[slot].append(item) slot_rows = db.query(c, ''' - SELECT attributeID, valueFloat FROM eve.dgmTypeAttributes - WHERE typeID = ? AND attributeID in (12, 13, 14, 1137, 1367) and valueFloat != 0.0 + SELECT attributeID, valueInt, valueFloat FROM eve.dgmTypeAttributes + WHERE typeID = ? AND attributeID IN (12, 13, 14, 1137, 1367) + AND (valueInt != 0 OR valueFloat != 0.0) ''', victim['ship_type_id']) slot_mapping = {12: 'low', 13: 'medium', 14: 'high', 1137: 'rig', 1367: 'subsystem'} slots = dict.fromkeys(slot_mapping.values(), 0) for attr in slot_rows: slot = slot_mapping[attr['attributeID']] - slots[slot] = int(attr['valueFloat']) # wtf CCP + slots[slot] = attr['valueInt'] or int(attr['valueFloat']) # wtf CCP if slots['subsystem']: sub_ids = map(lambda s: str(s['type_id']), items['subsystem']) modifier_rows = db.query(c, ''' @@ -126,7 +127,7 @@ def kill(kill_id): slot_mapping = {1374: 'high', 1375: 'medium', 1376: 'low'} # that's right, it's backwards for subs! for modifier in modifier_rows: slot = slot_mapping[modifier['attributeID']] - slots[slot] += int(modifier['valueFloat']) # you may be wondering why i'm still not using valueInt. i am too + slots[slot] += int(modifier['valueFloat']) # strangely, an improvement return { 'kill': kill, 'victim': victim, |