From 1cf844d4155043edf05ba8a1cede634c6a387002 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 30 Apr 2017 01:39:03 -0400 Subject: [PATCH] item.attributes would not contain attributes that were added during runtime. Instead, get the attribute info and search the modified attributes for the resist attribtue. --- eos/modifiedAttributeDict.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eos/modifiedAttributeDict.py b/eos/modifiedAttributeDict.py index 757d8a3d1..56ac737db 100644 --- a/eos/modifiedAttributeDict.py +++ b/eos/modifiedAttributeDict.py @@ -342,12 +342,13 @@ class ModifiedAttributeDict(collections.MutableMapping): # effect is applied. mod = self.fit.getModifier() remoteResistID = mod.getModifiedItemAttr("remoteResistanceID") or None + attrInfo = getAttributeInfo(int(remoteResistID)) - # We really don't have a way of getting a ships attribute by ID. Fail. - resist = next((x for x in self.fit.ship.item.attributes.values() if x.ID == remoteResistID), None) + # Get the attribute of the resist + resist = self.fit.ship.itemModifiedAttributes[attrInfo.attributeName] or None if remoteResistID and resist: - boostFactor *= resist.value + boostFactor *= resist # We just transform percentage boost into multiplication factor self.multiply(attributeName, 1 + boostFactor / 100.0, *args, **kwargs)