Fix issue when module is loaded with invalid item causing crash due to no item being available (incorrect logic)

This commit is contained in:
blitzmann
2016-04-03 02:04:52 -04:00
parent 8fc9724204
commit 1e621ee133

View File

@@ -131,14 +131,15 @@ class HandledModuleList(HandledList):
self.remove(mod)
return
# fix for #529, where a module may be in incorrect state after CCP changes mechanics of module
if not mod.isValidState(mod.state):
mod.state = eos.types.State.ONLINE
mod.position = len(self)
HandledList.append(self, mod)
if mod.isInvalid:
self.remove(mod)
return
# fix for #529, where a module may be in incorrect state after CCP changes mechanics of module
if not mod.isValidState(mod.state):
mod.state = eos.types.State.ONLINE
def insert(self, index, mod):
mod.position = index