Implement drone mutation support with some exceptions

This commit is contained in:
DarkPhoenix
2021-10-25 23:34:08 +03:00
parent 056685ded5
commit ea7a5b3c70
24 changed files with 494 additions and 167 deletions

View File

@@ -21,7 +21,10 @@ class GuiConvertMutatedLocalModuleCommand(wx.Command):
def Do(self):
sFit = Fit.getInstance()
fit = sFit.getFit(self.fitID)
mod = fit.modules[self.position]
try:
mod = fit.modules[self.position]
except IndexError:
return False
if mod.isEmpty:
return False
if mod.isMutated:

View File

@@ -19,7 +19,10 @@ class GuiRevertMutatedLocalModuleCommand(wx.Command):
def Do(self):
sFit = Fit.getInstance()
fit = sFit.getFit(self.fitID)
mod = fit.modules[self.position]
try:
mod = fit.modules[self.position]
except IndexError:
return False
if mod.isEmpty:
return False
if not mod.isMutated: