Update db and how we generate list of replacements
This commit is contained in:
@@ -804,10 +804,13 @@ class Market(object):
|
||||
replTypeIDs.update({int(i) for i in item.replaceBetter.split(",") if i})
|
||||
if not replTypeIDs:
|
||||
return ()
|
||||
# But as these replacements were generated with only item group and item skill
|
||||
# requirements in mind, they sometimes include stuff we do not want to include.
|
||||
# So here we also filter by variation group (implementing it during database
|
||||
# generation is not trivial and here it can be customized by overrides)
|
||||
variationItems = self.getVariationsByItems([item])
|
||||
replacementItems = {i for i in variationItems if i.ID in replTypeIDs}
|
||||
return replacementItems
|
||||
# As replacements were generated without keeping track which items were published,
|
||||
# filter them out here
|
||||
items = []
|
||||
for typeID in replTypeIDs:
|
||||
item = self.getItem(typeID)
|
||||
if not item:
|
||||
continue
|
||||
if self.getPublicityByItem(item):
|
||||
items.append(item)
|
||||
return items
|
||||
|
||||
Reference in New Issue
Block a user