From 88384a2fd8671ee8d8a73c5f0d039f7cfee7c20c Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Sun, 17 Jul 2016 14:10:58 -0700 Subject: [PATCH] RAH gets pissy if there is no damage profile If there is no damage profile (likely from one that's deleted, and somehow the profile doesn't get set back to uniform), then RAH tries to apply null values. This skips making the RAH reactive if that scenario happens. --- eos/effects/adaptivearmorhardener.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eos/effects/adaptivearmorhardener.py b/eos/effects/adaptivearmorhardener.py index c3955ebf0..1202b1fde 100644 --- a/eos/effects/adaptivearmorhardener.py +++ b/eos/effects/adaptivearmorhardener.py @@ -9,10 +9,10 @@ def handler(fit, module, context): #Adjust RAH to match the current damage pattern damagePattern = fit.damagePattern - attrDamagePattern = "%sAmount" % type - damagePatternModifier = getattr(damagePattern,attrDamagePattern)/float(sum((damagePattern.emAmount,damagePattern.thermalAmount,damagePattern.kineticAmount,damagePattern.explosiveAmount))) - modifiedResistModifier = (1-(((1-module.getModifiedItemAttr(attr))*4)*(damagePatternModifier))) - module.forceItemAttr(attr, modifiedResistModifier) + if damagePattern: + attrDamagePattern = "%sAmount" % type + damagePatternModifier = getattr(damagePattern,attrDamagePattern)/float(sum((damagePattern.emAmount,damagePattern.thermalAmount,damagePattern.kineticAmount,damagePattern.explosiveAmount))) + modifiedResistModifier = (1-(((1-module.getModifiedItemAttr(attr))*4)*(damagePatternModifier))) + module.forceItemAttr(attr, modifiedResistModifier) - fit.ship.multiplyItemAttr(attr, module.getModifiedItemAttr(attr), - stackingPenalties=True, penaltyGroup="preMul") + fit.ship.multiplyItemAttr(attr, module.getModifiedItemAttr(attr), stackingPenalties=True, penaltyGroup="preMul")