Merge remote-tracking branch 'ebag/ActiveDroneStacking'

This commit is contained in:
blitzman
2017-02-15 21:01:28 -05:00
2 changed files with 9 additions and 2 deletions

View File

@@ -147,6 +147,7 @@ class DroneView(Display):
def _merge(self, src, dst):
sFit = Fit.getInstance()
fitID = self.mainFrame.getActiveFit()
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 d2.amount > d2.amountActive:
d2.amountActive = d2.amount
eos.db.commit()
self.recalc(fit)
return True