Skip to content

Commit

Permalink
Fix for #324 - do not reset itemID automatically upon removal due to …
Browse files Browse the repository at this point in the history
…way modules are swapped.
  • Loading branch information
blitzmann committed Jul 9, 2015
1 parent 221a3fd commit 4c17f38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eos/effectHandlerHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def remove(self, thing):
# We must flag it as modified, otherwise it not be removed from the database
# @todo: flag_modified isn't in os x skel. need to rebuild to include
#flag_modified(thing, "itemID")
thing.itemID = 0
if thing.isInvalid: # see GH issue #324
thing.itemID = 0
list.remove(self, thing)

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

HandledList.append(self, thing)
Expand Down

0 comments on commit 4c17f38

Please sign in to comment.