From a7086b78cb440a08707a32b2fe331e8fc0fdc167 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 24 Nov 2017 00:55:23 -0500 Subject: [PATCH] Fix an issue with with Cap Power Relay using an effect without an expecting source attribute. Used to work, but with changes to getModifiedItemAttr need to default these to None --- eos/effects/capacitorcapacitymultiply.py | 4 +++- eos/effects/poweroutputmultiply.py | 4 +++- eos/effects/shieldcapacitymultiply.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/eos/effects/capacitorcapacitymultiply.py b/eos/effects/capacitorcapacitymultiply.py index 4b277a8da..8b5df217d 100644 --- a/eos/effects/capacitorcapacitymultiply.py +++ b/eos/effects/capacitorcapacitymultiply.py @@ -10,4 +10,6 @@ type = "passive" def handler(fit, module, context): - fit.ship.multiplyItemAttr("capacitorCapacity", module.getModifiedItemAttr("capacitorCapacityMultiplier")) + # We default this to None as there are times when the source attribute doesn't exist (for example, Cap Power Relay). + # It will return 0 as it doesn't exist, which would nullify whatever the target attribute is + fit.ship.multiplyItemAttr("capacitorCapacity", module.getModifiedItemAttr("capacitorCapacityMultiplier", None)) diff --git a/eos/effects/poweroutputmultiply.py b/eos/effects/poweroutputmultiply.py index 3a0e5c6a1..f4d5eb600 100644 --- a/eos/effects/poweroutputmultiply.py +++ b/eos/effects/poweroutputmultiply.py @@ -9,4 +9,6 @@ type = "passive" def handler(fit, module, context): - fit.ship.multiplyItemAttr("powerOutput", module.getModifiedItemAttr("powerOutputMultiplier")) + # We default this to None as there are times when the source attribute doesn't exist (for example, Cap Power Relay). + # It will return 0 as it doesn't exist, which would nullify whatever the target attribute is + fit.ship.multiplyItemAttr("powerOutput", module.getModifiedItemAttr("powerOutputMultiplier", None)) diff --git a/eos/effects/shieldcapacitymultiply.py b/eos/effects/shieldcapacitymultiply.py index 71c91f19e..3c9aeea6d 100644 --- a/eos/effects/shieldcapacitymultiply.py +++ b/eos/effects/shieldcapacitymultiply.py @@ -9,4 +9,6 @@ type = "passive" def handler(fit, module, context): - fit.ship.multiplyItemAttr("shieldCapacity", module.getModifiedItemAttr("shieldCapacityMultiplier")) + # We default this to None as there are times when the source attribute doesn't exist (for example, Cap Power Relay). + # It will return 0 as it doesn't exist, which would nullify whatever the target attribute is + fit.ship.multiplyItemAttr("shieldCapacity", module.getModifiedItemAttr("shieldCapacityMultiplier", None))