From 6c8efcda128a28fce19e5d1f481d6fd30cb2e8e3 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 18 Mar 2016 23:31:19 -0400 Subject: [PATCH] Fix traceback when ship is missing launcher / turret attribute (#539) --- eos/saveddata/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 1f5e84ec1..6ea98bfec 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -416,10 +416,10 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): # Check this only if we're told to do so if hardpointLimit: 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 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 True