diff --git a/eos/db/saveddata/databaseRepair.py b/eos/db/saveddata/databaseRepair.py index 0d133d5e6..d16c412b0 100644 --- a/eos/db/saveddata/databaseRepair.py +++ b/eos/db/saveddata/databaseRepair.py @@ -215,7 +215,7 @@ class DatabaseCleanup(object): row = results.first() if row and row['num']: - query = "UPDATE '{0}' SET '{1}Amount' = '0' WHERE {1}Amount IS NULL OR Amount = ''".format(profileType, + query = "UPDATE '{0}' SET '{1}Amount' = '0' WHERE {1}Amount IS NULL OR {1}Amount = ''".format(profileType, damageType) delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 5f2695710..0f6743d0b 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -728,12 +728,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) @@ -746,6 +740,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