Change behavior of module state switching
This commit is contained in:
@@ -913,13 +913,8 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
state = FittingModuleState.OFFLINE
|
||||
else:
|
||||
state = transitionMap[currState]
|
||||
if not mod.isValidState(state):
|
||||
state = -1
|
||||
|
||||
if mod.isValidState(state):
|
||||
return state
|
||||
else:
|
||||
return currState
|
||||
return mod.getMaxState(proposedState=state)
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
item = self.item
|
||||
|
||||
@@ -603,28 +603,3 @@ class FitDeprecated(object):
|
||||
eos.db.commit()
|
||||
|
||||
self.recalc(fit)
|
||||
|
||||
@deprecated
|
||||
def toggleModulesState(self, fitID, base, modules, click):
|
||||
pyfalog.debug("Toggle module state for fit ID: {0}", fitID)
|
||||
changed = False
|
||||
proposedState = es_Module.getProposedState(base, click)
|
||||
|
||||
if proposedState != base.state:
|
||||
changed = True
|
||||
base.state = proposedState
|
||||
for mod in modules:
|
||||
if mod != base:
|
||||
p = es_Module.getProposedState(mod, click, proposedState)
|
||||
mod.state = p
|
||||
if p != mod.state:
|
||||
changed = True
|
||||
|
||||
if changed:
|
||||
eos.db.commit()
|
||||
fit = eos.db.getFit(fitID)
|
||||
|
||||
# As some items may affect state-limiting attributes of the ship, calculate new attributes first
|
||||
self.recalc(fit)
|
||||
# Then, check states of all modules and change where needed. This will recalc if needed
|
||||
self.checkStates(fit, base)
|
||||
|
||||
Reference in New Issue
Block a user