Allow to change meta level of standup fighters

This commit is contained in:
DarkPhoenix
2019-09-23 16:44:26 +03:00
parent c13cd23d54
commit a43f9930de
2 changed files with 9 additions and 3 deletions

View File

@@ -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))

View File

@@ -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):