From a43f9930de60a20dca366a4ae153f4b6f14b129a Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Mon, 23 Sep 2019 16:44:26 +0300 Subject: [PATCH] Allow to change meta level of standup fighters --- eos/gamedata.py | 8 ++++++++ eos/saveddata/fit.py | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/eos/gamedata.py b/eos/gamedata.py index 6bc69379c..8041f78b9 100644 --- a/eos/gamedata.py +++ b/eos/gamedata.py @@ -530,6 +530,14 @@ class Item(EqBase): def isBooster(self): return self.group.name == 'Booster' and self.category.name == 'Implant' + @property + def isStandup(self): + if self.category.name == "Structure Module": + return True + if self.isFighter and {'fighterSquadronIsStandupLight', 'fighterSquadronIsStandupHeavy', 'fighterSquadronIsStandupSupport'}.intersection(self.attributes): + return True + return False + def __repr__(self): return "Item(ID={}, name={}) at {}".format( self.ID, self.name, hex(id(self)) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 4c683a26c..c26b31604 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -440,10 +440,8 @@ class Fit: return False # Citadel modules are now under a new category, so we can check this to ensure only structure modules can fit on a citadel - if isinstance(self.ship, Citadel) and item.category.name != "Structure Module" or \ - not isinstance(self.ship, Citadel) and item.category.name == "Structure Module": + if isinstance(self.ship, Citadel) is not item.isStandup: return False - return True def clear(self, projected=False, command=False):