diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index a44f8d135..a94a684e0 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -199,6 +199,10 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): if self.owner: return self.owner.modules.index(self) + @property + def isCapitalSize(self): + return self.getModifiedItemAttr("volume", 0) >= 4000 + @property def hpBeforeReload(self): """ @@ -418,6 +422,11 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): if isinstance(fit.ship, Citadel) and len(fitsOnGroup) == 0 and len(fitsOnType) == 0: return False + # EVE doesn't let capital modules be fit onto subcapital hulls. Confirmed by CCP Larrikin that this is dictated + # by the modules volume. See GH issue #1096 + if (fit.ship.getModifiedItemAttr("isCapitalSize", 0) != 1 and self.isCapitalSize): + return False + # If the mod is a subsystem, don't let two subs in the same slot fit if self.slot == Slot.SUBSYSTEM: subSlot = self.getModifiedItemAttr("subSystemSlot") diff --git a/gui/builtinContextMenus/metaSwap.py b/gui/builtinContextMenus/metaSwap.py index b2a128ce0..950a9be8e 100644 --- a/gui/builtinContextMenus/metaSwap.py +++ b/gui/builtinContextMenus/metaSwap.py @@ -179,8 +179,8 @@ class MetaSwap(ContextMenu): elif isinstance(selected_item, Implant): for idx, implant_stack in enumerate(fit.implants): if implant_stack is selected_item: - sFit.removeImplant(fitID, idx) - sFit.addImplant(fitID, item.ID, False) + sFit.removeImplant(fitID, idx, False) + sFit.addImplant(fitID, item.ID, True) break wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID)) diff --git a/service/fit.py b/service/fit.py index f44109d16..b14250f17 100644 --- a/service/fit.py +++ b/service/fit.py @@ -276,7 +276,7 @@ class Fit(object): self.recalc(fit) return True - def removeImplant(self, fitID, position): + def removeImplant(self, fitID, position, recalc=True): pyfalog.debug("Removing implant from position ({0}) for fit ID: {1}", position, fitID) if fitID is None: return False @@ -284,7 +284,8 @@ class Fit(object): fit = eos.db.getFit(fitID) implant = fit.implants[position] fit.implants.remove(implant) - self.recalc(fit) + if recalc: + self.recalc(fit) return True def addBooster(self, fitID, itemID, recalc=True):