Fix system effect states

This commit is contained in:
blitzmann
2015-09-22 21:45:32 -04:00
parent 492776c5a8
commit a08bb2494b
3 changed files with 30 additions and 14 deletions

View File

@@ -604,8 +604,8 @@ class Fit(object):
Slot.RIG: "rigSlots",
Slot.SUBSYSTEM: "maxSubSystems"}
if type == Slot.MODE:
# Mode slot doesn't really exist, return default 0
if type in (Slot.MODE, Slot.SYSTEM):
# These slots don't really exist, return default 0
return 0
slotsUsed = self.getSlotsUsed(type, countDummies)

View File

@@ -35,12 +35,17 @@ class State(Enum):
OVERHEATED = 2
class Slot(Enum):
# These are self-explanatory
LOW = 1
MED = 2
HIGH = 3
RIG = 4
SUBSYSTEM = 5
MODE = 6 # not a real slot, need for pyfa display rack separation
# not a real slot, need for pyfa display rack separation
MODE = 6
# system effects. They are projected "modules" and pyfa assumes all modules
# have a slot. In this case, make one up.
SYSTEM = 7
class Hardpoint(Enum):
NONE = 0
@@ -528,7 +533,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
if effectName in item.effects:
return slot
if item.group.name == "Effect Beacon":
return Slot.RIG
return Slot.SYSTEM
raise ValueError("Passed item does not fit in any known slot")