Fix Racks having a CPU and Power value of 0

This commit is contained in:
blitzmann
2017-11-04 18:32:26 -04:00
parent 0e1e4cad6d
commit 3b0c8b6117

View File

@@ -72,7 +72,7 @@ class AttributeDisplay(ViewColumn):
def getText(self, mod):
if hasattr(mod, "item"):
attr = mod.getModifiedItemAttr(self.info.name)
attr = mod.getModifiedItemAttr(self.info.name, None)
else:
if self.direct:
info = self.directInfo
@@ -80,6 +80,9 @@ class AttributeDisplay(ViewColumn):
else:
attr = mod.getAttribute(self.info.name)
if attr is None:
return ""
if self.info.name == "volume":
str_ = (formatAmount(attr, 3, 0, 3))
if hasattr(mod, "amount"):
@@ -89,7 +92,7 @@ class AttributeDisplay(ViewColumn):
if isinstance(attr, (float, int)):
attr = (formatAmount(attr, 3, 0, 3))
return attr if attr is not None else ""
return attr
def getImageId(self, mod):
return -1