From 5f355534388089eff02b8b5e906454420b176403 Mon Sep 17 00:00:00 2001 From: Ryan Holmes Date: Wed, 5 Apr 2017 18:54:16 -0400 Subject: [PATCH] Restrict cap modules to only cap ships (#1097) * Restrict capital modules to capital hulls * tweak comment * Make a isCapitalSize property for modules --- eos/saveddata/module.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 8287f349a..919b8c7b7 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")