* Break project application code out of main item iteration, and apply it after command boosts have been applied to the fit. Fix for #1081

* Make tox happy
This commit is contained in:
Ryan Holmes
2017-04-01 22:23:50 -05:00
committed by GitHub
parent fd745c5f62
commit e03b3227d4

View File

@@ -732,12 +732,6 @@ class Fit(object):
self.register(item)
item.calculateModifiedAttributes(self, runTime, False)
if projected is True and projectionInfo and item not in chain.from_iterable(r):
# apply effects onto target fit
for _ in xrange(projectionInfo.amount):
targetFit.register(item, origin=self)
item.calculateModifiedAttributes(targetFit, runTime, True)
if targetFit and withBoosters and item in self.modules:
# Apply the gang boosts to target fit
# targetFit.register(item, origin=self)
@@ -750,6 +744,16 @@ class Fit(object):
if not withBoosters and self.commandBonuses:
self.__runCommandBoosts(runTime)
# Projection effects have been broken out of the main loop, see GH issue #1081
if projected is True and projectionInfo:
for item in chain.from_iterable(u):
if item is not None:
# apply effects onto target fit
for _ in xrange(projectionInfo.amount):
targetFit.register(item, origin=self)
item.calculateModifiedAttributes(targetFit, runTime, True)
timer.checkpoint('Done with runtime: %s' % runTime)
# Mark fit as calculated