All things that can affect attribute from current fit/ships is included in modifiedAttributeDict.

The previous method was to only add those that change a value. This adds things can can affect it, and then pass a new `used` flag to the dict to show if it's used or not.
This commit is contained in:
blitzmann
2014-05-25 14:48:40 -04:00
parent f1f9da9214
commit 45fca2a87d
3 changed files with 12 additions and 14 deletions

View File

@@ -615,13 +615,15 @@ class ItemAffectedBy (wx.Panel):
cont = self.stuff.itemModifiedAttributes if self.item == self.stuff.item else self.stuff.chargeModifiedAttributes
things = {}
for attrName in cont.iterAfflictions():
# if value is 0 or there has been no change from original to modified, return
if cont[attrName] == (cont.getOriginal(attrName) or 0):
continue
for fit, afflictors in cont.getAfflictions(attrName).iteritems():
for afflictor, modifier, amount in afflictors:
if afflictor.item is None:
for afflictor, modifier, amount, used in afflictors:
if not used or afflictor.item is None:
continue
if afflictor.item.name not in things:
things[afflictor.item.name] = [type(afflictor), set(), set()]