Skip to content

Commit

Permalink
Merge pull request #828 from resinneublem/group-drones-for-dna-export
Browse files Browse the repository at this point in the history
Groups drones before generating DNA
  • Loading branch information
blitzmann authored Dec 2, 2016
2 parents 34e3aa2 + e6dead2 commit bb96b0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion service/port.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,13 @@ def exportDna(fit):
for mod in mods:
dna += ":{0};{1}".format(mod, mods[mod])

# drones are known to be in split stacks
groupedDrones = OrderedDict()
for drone in fit.drones:
dna += ":{0};{1}".format(drone.itemID, drone.amount)
groupedDrones[drone.itemID] = groupedDrones.get(drone.itemID, 0) + drone.amount

for droneItemID in groupedDrones:
dna += ":{0};{1}".format(droneItemID, groupedDrones[droneItemID])

for cargo in fit.cargo:
# DNA format is a simple/dumb format. As CCP uses the slot information of the item itself
Expand Down

0 comments on commit bb96b0a

Please sign in to comment.