From 9de3600d7f3764baa622e428064be3bda27088b6 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Thu, 23 Jul 2015 01:32:48 -0400 Subject: [PATCH] Fix self-boosting --- eos/saveddata/fit.py | 23 ++++++----------------- service/fit.py | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index a669f99ea..d2de8dfc1 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -393,7 +393,7 @@ class Fit(object): return self.__origin def __calculateGangBoosts(self, runTime): - logger.debug("Applying gang boosts in `%s` runtime for %s", runTime, self) + logger.debug("Applying gang boosts in `%s` runtime for %s", runTime, repr(self)) for name, info in self.gangBoosts.iteritems(): # Unpack all data required to run effect properly effect, thing = info[1] @@ -418,7 +418,7 @@ class Fit(object): def calculateModifiedAttributes(self, targetFit=None, withBoosters=False, dirtyStorage=None): timer = Timer('Fit: {}, {}'.format(self.ID, self.name), logger) - logger.debug("Starting fit calculation on: %s", repr(self)) + logger.debug("Starting fit calculation on: %s, withBoosters: %s", repr(self), withBoosters) shadow = False if targetFit: @@ -436,23 +436,12 @@ class Fit(object): # not want to save this fit to the database, so simply remove it eos.db.saveddata_session.delete(self) - refreshBoosts = False - if withBoosters is True: - refreshBoosts = True - if dirtyStorage is not None and self.ID in dirtyStorage: - refreshBoosts = True - if dirtyStorage is not None: - dirtyStorage.update(self.boostsFits) - if self.fleet is not None and refreshBoosts is True: + if self.fleet is not None and withBoosters is True: logger.debug("Fleet is set, gathering gang boosts") - self.gangBoosts = self.fleet.recalculateLinear(withBoosters=withBoosters, dirtyStorage=dirtyStorage) + self.gangBoosts = self.fleet.recalculateLinear(withBoosters=withBoosters) + timer.checkpoint("Done calculating gang boosts for %s"%repr(self)) elif self.fleet is None: self.gangBoosts = None - if dirtyStorage is not None: - try: - dirtyStorage.remove(self.ID) - except KeyError: - pass # If we're not explicitly asked to project fit onto something, # set self as target fit @@ -476,7 +465,7 @@ class Fit(object): # projection have modifying stuff applied, such as gang boosts and other # local modules that may help if self.__calculated and not projected: - logger.debug("Fit has already been calculated and is not projected, returning") + logger.debug("Fit has already been calculated and is not projected, returning: %s", repr(self)) return # Mark fit as calculated diff --git a/service/fit.py b/service/fit.py index 2ac93e4ee..e848b45d7 100644 --- a/service/fit.py +++ b/service/fit.py @@ -946,4 +946,4 @@ class Fit(object): if fit.factorReload is not self.serviceFittingOptions["useGlobalForceReload"]: fit.factorReload = self.serviceFittingOptions["useGlobalForceReload"] fit.clear() - fit.calculateModifiedAttributes(withBoosters=withBoosters, dirtyStorage=self.dirtyFitIDs) + fit.calculateModifiedAttributes(withBoosters=withBoosters)