From 2857eff88416fe172239aef01cebe2a88e76ee29 Mon Sep 17 00:00:00 2001 From: Ryan Holmes Date: Tue, 13 Jun 2017 23:57:27 -0400 Subject: [PATCH] Fix a few None comparison operations... python 3 has changed this. I'm sure there's going to be a lot of these issues popping up. Oh, and now we get a hard crash when opening a fit. Yey! --- eos/saveddata/module.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index a07fe07f5..f0eb42921 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -178,7 +178,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): @property def numShots(self): if self.charge is None: - return None + return -1 if self.__chargeCycles is None and self.charge: numCharges = self.numCharges # Usual ammo like projectiles and missiles @@ -738,13 +738,12 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): @property def rawCycleTime(self): speed = max( - self.getModifiedItemAttr("speed"), # Most weapons - self.getModifiedItemAttr("duration"), # Most average modules - self.getModifiedItemAttr("durationSensorDampeningBurstProjector"), - self.getModifiedItemAttr("durationTargetIlluminationBurstProjector"), - self.getModifiedItemAttr("durationECMJammerBurstProjector"), - self.getModifiedItemAttr("durationWeaponDisruptionBurstProjector"), - 0, # Return 0 if none of the above are valid + self.getModifiedItemAttr("speed", 0), # Most weapons + self.getModifiedItemAttr("duration", 0), # Most average modules + self.getModifiedItemAttr("durationSensorDampeningBurstProjector", 0), + self.getModifiedItemAttr("durationTargetIlluminationBurstProjector", 0), + self.getModifiedItemAttr("durationECMJammerBurstProjector", 0), + self.getModifiedItemAttr("durationWeaponDisruptionBurstProjector", 0) ) return speed