Remove calling es_Module from effectHandlerHelpers, this causes a circular import. Instead pass in from fit.
This commit is contained in:
@@ -164,26 +164,21 @@ class HandledModuleList(HandledList):
|
||||
for i in xrange(oldPos, len(self)):
|
||||
self[i].position -= 1
|
||||
|
||||
def toDummy(self, index):
|
||||
mod = self[index]
|
||||
if not mod.isEmpty:
|
||||
pass
|
||||
# TODO: This can't point to es_Module, cyclical import loop
|
||||
'''
|
||||
dummy = es_Module.buildEmpty(mod.slot)
|
||||
dummy.position = index
|
||||
self[index] = dummy
|
||||
'''
|
||||
|
||||
def toModule(self, index, mod):
|
||||
mod.position = index
|
||||
self[index] = mod
|
||||
|
||||
def freeSlot(self, slot):
|
||||
def toDummy(self, index, dummy):
|
||||
mod = self[index]
|
||||
if not mod.isEmpty:
|
||||
dummy.position = index
|
||||
self[index] = dummy
|
||||
|
||||
def freeSlot(self, slot, dummy):
|
||||
for i in range(len(self)):
|
||||
mod = self[i]
|
||||
if mod.getModifiedItemAttr("subSystemSlot") == slot:
|
||||
self.toDummy(i)
|
||||
self.toDummy(i, dummy)
|
||||
break
|
||||
|
||||
|
||||
|
||||
@@ -421,7 +421,9 @@ class Fit(object):
|
||||
return False
|
||||
|
||||
if m.item.category.name == "Subsystem":
|
||||
fit.modules.freeSlot(m.getModifiedItemAttr("subSystemSlot"))
|
||||
slot = m.getModifiedItemAttr("subSystemSlot")
|
||||
dummy_module = es_Module.buildEmpty(fit.modules[slot])
|
||||
fit.modules.freeSlot(slot, dummy_module)
|
||||
|
||||
if m.fits(fit):
|
||||
m.owner = fit
|
||||
@@ -448,7 +450,8 @@ class Fit(object):
|
||||
return None
|
||||
|
||||
numSlots = len(fit.modules)
|
||||
fit.modules.toDummy(position)
|
||||
dummy_module = es_Module.buildEmpty(fit.modules[position].slot)
|
||||
fit.modules.toDummy(position, dummy_module)
|
||||
self.recalc(fit)
|
||||
self.checkStates(fit, None)
|
||||
fit.fill()
|
||||
@@ -459,7 +462,8 @@ class Fit(object):
|
||||
fit = eos.db.getFit(fitID)
|
||||
|
||||
# Dummy it out in case the next bit fails
|
||||
fit.modules.toDummy(position)
|
||||
dummy_module = es_Module.buildEmpty(fit.modules[position].slot)
|
||||
fit.modules.toDummy(position, dummy_module)
|
||||
|
||||
item = eos.db.getItem(newItemID, eager=("attributes", "group.category"))
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user