Handle this at a lower level.

This commit is contained in:
Ebag333
2017-02-15 09:20:22 -08:00
parent 71ca7d153e
commit 489637ec67
2 changed files with 8 additions and 7 deletions

View File

@@ -148,11 +148,6 @@ class DroneView(Display):
sFit = Fit.getInstance()
fitID = self.mainFrame.getActiveFit()
# If either stack has active drones, make them all active. Fixes #728
if (getattr(self.drones[src], "amountActive", 0) + getattr(self.drones[dst], "amountActive", 0)) > 0:
self.drones[src].amountActive = getattr(self.drones[src], "amount", 0)
self.drones[dst].amountActive = getattr(self.drones[dst], "amount", 0)
if sFit.mergeDrones(fitID, self.drones[src], self.drones[dst]):
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))

View File

@@ -726,8 +726,14 @@ class Fit(object):
else:
fit.drones.remove(d1)
d2.amount += d1.amount
d2.amountActive += d1.amountActive if d1.amountActive > 0 else -d2.amountActive
d2.amount += getattr(d1, "amount", 0)
d2.amountActive += getattr(d1, "amountActive", 0)
# If we have less than the total number of drones active, make them all active. Fixes #728
# This could be removed if we ever add an enhancement to make drone stacks partially active.
if getattr(d2, "amount", 0) > getattr(d2, "amountActive", 0):
d2.amountActive = getattr(d2, "amount", 0)
eos.db.commit()
self.recalc(fit)
return True