Skip to content

Commit

Permalink
Handle edge case of unit test with no options object
Browse files Browse the repository at this point in the history
  • Loading branch information
hatkirby committed Nov 20, 2023
1 parent 9612a44 commit 380eea2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions worlds/lingo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ def create_item(self, name: str) -> Item:
item = ALL_ITEM_TABLE[name]

classification = item.classification
if self.options.shuffle_paintings and len(item.painting_ids) > 0 and len(item.door_ids) == 0\
and all(painting_id not in self.player_logic.PAINTING_MAPPING for painting_id in item.painting_ids):
if hasattr(self, "options") and self.options.shuffle_paintings and len(item.painting_ids) > 0\
and len(item.door_ids) == 0 and all(painting_id not in self.player_logic.PAINTING_MAPPING
for painting_id in item.painting_ids):
# If this is a "door" that just moves one or more paintings, and painting shuffle is on and those paintings
# go nowhere, then this item should not be progression.
classification = ItemClassification.filler
Expand Down

0 comments on commit 380eea2

Please sign in to comment.