Fix running mining effect for every active drone in the stack

This commit is contained in:
blitzman
2016-10-17 00:14:06 -04:00
parent a50471c0a6
commit d43db40469
2 changed files with 9 additions and 3 deletions

View File

@@ -4,6 +4,8 @@
# Mining Drones
type = "passive"
grouped = True
def handler(fit, container, context):
miningDroneAmountPercent = container.getModifiedItemAttr("miningDroneAmountPercent")
if (miningDroneAmountPercent is None) or (miningDroneAmountPercent == 0):

View File

@@ -222,10 +222,14 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
if effect.runTime == runTime and \
((projected == True and effect.isType("projected")) or \
projected == False and effect.isType("passive")):
i = 0
while i != self.amountActive:
# See GH issue #765
if effect.getattr('grouped'):
effect.handler(fit, self, context)
i += 1
else:
i = 0
while i != self.amountActive:
effect.handler(fit, self, context)
i += 1
if self.charge:
for effect in self.charge.effects.itervalues():