Fix traceback when ship is missing launcher / turret attribute (#539)
This commit is contained in:
@@ -416,10 +416,10 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
|||||||
# Check this only if we're told to do so
|
# Check this only if we're told to do so
|
||||||
if hardpointLimit:
|
if hardpointLimit:
|
||||||
if self.hardpoint == Hardpoint.TURRET:
|
if self.hardpoint == Hardpoint.TURRET:
|
||||||
if fit.ship.getModifiedItemAttr('turretSlotsLeft') - fit.getHardpointsUsed(Hardpoint.TURRET) < 1:
|
if (fit.ship.getModifiedItemAttr('turretSlotsLeft') or 0) - fit.getHardpointsUsed(Hardpoint.TURRET) < 1:
|
||||||
return False
|
return False
|
||||||
elif self.hardpoint == Hardpoint.MISSILE:
|
elif self.hardpoint == Hardpoint.MISSILE:
|
||||||
if fit.ship.getModifiedItemAttr('launcherSlotsLeft') - fit.getHardpointsUsed(Hardpoint.MISSILE) < 1:
|
if (fit.ship.getModifiedItemAttr('launcherSlotsLeft')or 0) - fit.getHardpointsUsed(Hardpoint.MISSILE) < 1:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user