Make sure getModifiedItemAttr always returns an int, unless otherwise wanting None

In py2, you could compare None to an int and it would always be less than. Unfortunately in py3, this is no longer the case. Returning getModifiedItemAttr as 0 allows us to not do a huge refactor.
This commit is contained in:
blitzmann
2017-11-04 18:20:00 -04:00
parent 56f34873a6
commit ce3b94696a
5 changed files with 9 additions and 8 deletions

View File

@@ -213,7 +213,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
armorRep = self.getModifiedItemAttr("armorDamageAmount") or 0
shieldRep = self.getModifiedItemAttr("shieldBonus") or 0
if not cycles or (not armorRep and not shieldRep):
return None
return 0
hp = round((armorRep + shieldRep) * cycles)
return hp