Reverts commit de87c9, and instead uses the mod variable to access the method needed.
Conflicts: service/fit.py
This commit is contained in:
@@ -152,21 +152,23 @@ 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:
|
||||
dummy = mod.buildEmpty(mod.slot)
|
||||
dummy.position = index
|
||||
self[index] = dummy
|
||||
|
||||
|
||||
def toModule(self, index, mod):
|
||||
mod.position = index
|
||||
self[index] = mod
|
||||
|
||||
def toDummy(self, index, dummy):
|
||||
mod = self[index]
|
||||
if not mod.isEmpty:
|
||||
dummy.position = index
|
||||
self[index] = dummy
|
||||
|
||||
def freeSlot(self, slot, dummy):
|
||||
def freeSlot(self, slot):
|
||||
for i in range(len(self)):
|
||||
mod = self[i]
|
||||
if mod.getModifiedItemAttr("subSystemSlot") == slot:
|
||||
self.toDummy(i, dummy)
|
||||
self.toDummy(i)
|
||||
break
|
||||
|
||||
|
||||
|
||||
@@ -433,7 +433,7 @@ class Fit(object):
|
||||
return False
|
||||
|
||||
if m.item.category.name == "Subsystem":
|
||||
fit.modules.freeSlot(m.getModifiedItemAttr("subSystemSlot"), es_Module.buildEmpty(m.slot))
|
||||
fit.modules.freeSlot(m.getModifiedItemAttr("subSystemSlot"))
|
||||
|
||||
if m.fits(fit):
|
||||
m.owner = fit
|
||||
@@ -460,8 +460,7 @@ class Fit(object):
|
||||
return None
|
||||
|
||||
numSlots = len(fit.modules)
|
||||
dummy_module = es_Module.buildEmpty(fit.modules[position].slot)
|
||||
fit.modules.toDummy(position, dummy_module)
|
||||
fit.modules.toDummy(position)
|
||||
self.recalc(fit)
|
||||
self.checkStates(fit, None)
|
||||
fit.fill()
|
||||
@@ -472,8 +471,7 @@ class Fit(object):
|
||||
fit = eos.db.getFit(fitID)
|
||||
|
||||
# Dummy it out in case the next bit fails
|
||||
dummy_module = es_Module.buildEmpty(fit.modules[position].slot)
|
||||
fit.modules.toDummy(position, dummy_module)
|
||||
fit.modules.toDummy(position)
|
||||
|
||||
item = eos.db.getItem(newItemID, eager=("attributes", "group.category"))
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user