@@ -319,17 +319,8 @@ class Fit(object):
|
|||||||
else:
|
else:
|
||||||
c = chain((self.character, self.ship), self.drones, self.boosters, self.appliedImplants, self.modules,
|
c = chain((self.character, self.ship), self.drones, self.boosters, self.appliedImplants, self.modules,
|
||||||
self.projectedDrones, self.projectedModules)
|
self.projectedDrones, self.projectedModules)
|
||||||
|
|
||||||
for item in c:
|
|
||||||
# Registering the item about to affect the fit allows us to track "Affected By" relations correctly
|
|
||||||
if item is not None:
|
|
||||||
self.register(item)
|
|
||||||
item.calculateModifiedAttributes(self, runTime, False)
|
|
||||||
if forceProjected is True:
|
|
||||||
targetFit.register(item)
|
|
||||||
item.calculateModifiedAttributes(targetFit, runTime, True)
|
|
||||||
if self.gangBoosts is not None:
|
if self.gangBoosts is not None:
|
||||||
#print self.gangBoosts
|
|
||||||
contextMap = {Skill: "skill",
|
contextMap = {Skill: "skill",
|
||||||
Ship: "ship",
|
Ship: "ship",
|
||||||
Module: "module",
|
Module: "module",
|
||||||
@@ -344,17 +335,27 @@ class Fit(object):
|
|||||||
(effect.isType("active") and thing.state >= State.ACTIVE):
|
(effect.isType("active") and thing.state >= State.ACTIVE):
|
||||||
# Run effect, and get proper bonuses applied
|
# Run effect, and get proper bonuses applied
|
||||||
try:
|
try:
|
||||||
effect.handler(targetFit, thing, context)
|
effect.handler(self, thing, context)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# Run effect, and get proper bonuses applied
|
# Run effect, and get proper bonuses applied
|
||||||
try:
|
try:
|
||||||
effect.handler(targetFit, thing, context)
|
effect.handler(self, thing, context)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
for item in c:
|
||||||
|
# Registering the item about to affect the fit allows us to track "Affected By" relations correctly
|
||||||
|
if item is not None:
|
||||||
|
self.register(item)
|
||||||
|
item.calculateModifiedAttributes(self, runTime, False)
|
||||||
|
if forceProjected is True:
|
||||||
|
targetFit.register(item)
|
||||||
|
item.calculateModifiedAttributes(targetFit, runTime, True)
|
||||||
|
|
||||||
for fit in self.projectedFits:
|
for fit in self.projectedFits:
|
||||||
fit.calculateModifiedAttributes(self, dirtyStorage=dirtyStorage)
|
fit.calculateModifiedAttributes(self, withBoosters=withBoosters, dirtyStorage=dirtyStorage)
|
||||||
|
|
||||||
def fill(self):
|
def fill(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -220,7 +220,11 @@ class Fit(object):
|
|||||||
eos.db.commit()
|
eos.db.commit()
|
||||||
self.recalc(fit, withBoosters=True)
|
self.recalc(fit, withBoosters=True)
|
||||||
|
|
||||||
def getFit(self, fitID):
|
def getFit(self, fitID, projected = False):
|
||||||
|
''' Gets fit from database, and populates fleet data.
|
||||||
|
|
||||||
|
Projected is a recursion flag that is set to reduce recursions into projected fits
|
||||||
|
'''
|
||||||
if fitID is None:
|
if fitID is None:
|
||||||
return None
|
return None
|
||||||
fit = eos.db.getFit(fitID)
|
fit = eos.db.getFit(fitID)
|
||||||
@@ -233,8 +237,13 @@ class Fit(object):
|
|||||||
fit.fleet = None
|
fit.fleet = None
|
||||||
else:
|
else:
|
||||||
fit.fleet = f
|
fit.fleet = f
|
||||||
self.recalc(fit, withBoosters=True)
|
|
||||||
fit.fill()
|
if not projected:
|
||||||
|
for fitP in fit.projectedFits:
|
||||||
|
self.getFit(fitP.ID, projected = True)
|
||||||
|
self.recalc(fit, withBoosters=True)
|
||||||
|
fit.fill()
|
||||||
|
|
||||||
eos.db.commit()
|
eos.db.commit()
|
||||||
fit.inited = True
|
fit.inited = True
|
||||||
return fit
|
return fit
|
||||||
|
|||||||
Reference in New Issue
Block a user