Skip to content

Commit 4c17f38

Browse files
committed
Fix for #324 - do not reset itemID automatically upon removal due to way modules are swapped.
1 parent 221a3fd commit 4c17f38

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

eos/effectHandlerHelpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def remove(self, thing):
109109
# We must flag it as modified, otherwise it not be removed from the database
110110
# @todo: flag_modified isn't in os x skel. need to rebuild to include
111111
#flag_modified(thing, "itemID")
112-
thing.itemID = 0
112+
if thing.isInvalid: # see GH issue #324
113+
thing.itemID = 0
113114
list.remove(self, thing)
114115

115116
class HandledModuleList(HandledList):
@@ -191,6 +192,7 @@ def append(self, thing):
191192
oldObj = next((m for m in self if m.slot == thing.slot), None)
192193
if oldObj:
193194
logging.info("Slot %d occupied with %s, replacing with %s", thing.slot, oldObj.item.name, thing.item.name)
195+
oldObj.itemID = 0 # hack to remove from DB. See GH issue #324
194196
self.remove(oldObj)
195197

196198
HandledList.append(self, thing)

0 commit comments

Comments
 (0)