From d43db404697d893bfd74e6c3b7bddaa20220e417 Mon Sep 17 00:00:00 2001 From: blitzman Date: Mon, 17 Oct 2016 00:14:06 -0400 Subject: [PATCH] Fix running mining effect for every active drone in the stack --- eos/effects/mining.py | 2 ++ eos/saveddata/drone.py | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/eos/effects/mining.py b/eos/effects/mining.py index f98faf17b..23a5bf7e7 100644 --- a/eos/effects/mining.py +++ b/eos/effects/mining.py @@ -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): diff --git a/eos/saveddata/drone.py b/eos/saveddata/drone.py index 507c55681..8033384ab 100644 --- a/eos/saveddata/drone.py +++ b/eos/saveddata/drone.py @@ -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():