diff --git a/eos/gamedata.py b/eos/gamedata.py index 7c7f85b8f..0fc9482e2 100644 --- a/eos/gamedata.py +++ b/eos/gamedata.py @@ -476,6 +476,10 @@ class Item(EqBase): def getAbyssalYypes(cls): cls.ABYSSAL_TYPES = eos.db.getAbyssalTypes() + @property + def isCharge(self): + return self.category.name == "Charge" + def __repr__(self): return "Item(ID={}, name={}) at {}".format( self.ID, self.name, hex(id(self)) diff --git a/gui/fitCommands/moduleAdd.py b/gui/fitCommands/moduleAdd.py index a783c241d..e035dbfd0 100644 --- a/gui/fitCommands/moduleAdd.py +++ b/gui/fitCommands/moduleAdd.py @@ -22,6 +22,8 @@ class GuiModuleAddCommand(wx.Command): def Do(self): success = False # if we have a position set, try to apply the module to that position + + # todo: check to see if item is a charge. if it is, dont try to add module, but instead set amm if self.new_position: success = self.internal_history.Submit(FitReplaceModuleCommand(self.fitID, self.new_position, self.itemID)) if not success: diff --git a/service/fit.py b/service/fit.py index d4bd396dc..175292666 100644 --- a/service/fit.py +++ b/service/fit.py @@ -1077,7 +1077,8 @@ class Fit(object): @staticmethod def isAmmo(itemID): - return eos.db.getItem(itemID).category.name == "Charge" + # todo: get rid of this form the service, use directly from item + return eos.db.getItem(itemID).isCharge @deprecated def setAmmo(self, fitID, ammoID, modules, recalc=True):