Add citadel fittings to market browser, and get rid of some initial errors

This commit is contained in:
blitzmann
2016-05-15 18:58:47 -04:00
parent 523f7793b5
commit 7cf0a35a7a
4 changed files with 9 additions and 4 deletions

View File

@@ -743,6 +743,10 @@ class Fit(object):
capacity = self.ship.getModifiedItemAttr("capacitorCapacity")
mass = self.ship.getModifiedItemAttr("mass")
warpCapNeed = self.ship.getModifiedItemAttr("warpCapacitorNeed")
if not warpCapNeed:
return 0
return capacity / (mass * warpCapNeed)
@property

View File

@@ -151,7 +151,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
def isInvalid(self):
if self.isEmpty:
return False
return self.__item is None or (self.__item.category.name not in ("Module", "Subsystem") and self.__item.group.name != "Effect Beacon")
return self.__item is None or (self.__item.category.name not in ("Module", "Subsystem", "Structure Module") and self.__item.group.name != "Effect Beacon")
@property
def numCharges(self):

View File

@@ -43,7 +43,7 @@ class Ship(ItemAttrShortcut, HandledItem):
def __init__(self, item, parent=None):
if item.category.name != "Ship":
if item.category.name not in ("Ship", "Structure"):
raise ValueError('Passed item "%s" (category: (%s)) is not under Ship category'%(item.name, item.category.name))
self.__item = item

View File

@@ -329,14 +329,15 @@ class Market():
("faction", frozenset((4, 3))),
("complex", frozenset((6,))),
("officer", frozenset((5,)))])
self.SEARCH_CATEGORIES = ("Drone", "Module", "Subsystem", "Charge", "Implant", "Deployable", "Fighter")
self.SEARCH_CATEGORIES = ("Drone", "Module", "Subsystem", "Charge", "Implant", "Deployable", "Fighter", "Structure")
self.ROOT_MARKET_GROUPS = (9, # Modules
1111, # Rigs
157, # Drones
11, # Ammo
1112, # Subsystems
24, # Implants & Boosters
404) # Deployables
404, # Deployables
2202) # Structure Equipment
# Tell other threads that Market is at their service
mktRdy.set()