From f17fb82ce77ae2ccf09fc71293f310034bc2fdec Mon Sep 17 00:00:00 2001 From: blitzmann Date: Mon, 5 Oct 2015 18:10:39 -0400 Subject: [PATCH] Fix issue with ship bonuses not applying when fit is projected (#374) --- eos/saveddata/character.py | 7 +++++++ eos/saveddata/fit.py | 4 ++-- eos/saveddata/ship.py | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index 06559b8eb..522ad590a 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -23,7 +23,9 @@ from sqlalchemy.orm import validates, reconstructor from eos.effectHandlerHelpers import HandledItem import eos.db import eos +import logging +logger = logging.getLogger(__name__) class Character(object): __itemList = None @@ -221,6 +223,11 @@ class Character(object): if map[key](val) == False: raise ValueError(str(val) + " is not a valid value for " + key) else: return val + def __repr__(self): + return "Character(ID={}, name={}) at {}".format( + self.ID, self.name, hex(id(self)) + ) + class Skill(HandledItem): def __init__(self, item, level=0, ro=False, learned=True): self.__item = item if not isinstance(item, int) else None diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index d913eec19..81a53665a 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -390,9 +390,9 @@ class Fit(object): self.__modifier = currModifier self.__origin = origin if hasattr(currModifier, "itemModifiedAttributes"): - currModifier.itemModifiedAttributes.fit = self + currModifier.itemModifiedAttributes.fit = origin or self if hasattr(currModifier, "chargeModifiedAttributes"): - currModifier.chargeModifiedAttributes.fit = self + currModifier.chargeModifiedAttributes.fit = origin or self def getModifier(self): return self.__modifier diff --git a/eos/saveddata/ship.py b/eos/saveddata/ship.py index 094c02c3f..daa5e99ec 100644 --- a/eos/saveddata/ship.py +++ b/eos/saveddata/ship.py @@ -121,3 +121,8 @@ class Ship(ItemAttrShortcut, HandledItem): def __deepcopy__(self, memo): copy = Ship(self.item) return copy + + def __repr__(self): + return "Ship(ID={}, name={}) at {}".format( + self.item.ID, self.item.name, hex(id(self)) + )