Skip to content

Commit

Permalink
Protection against item == None
Browse files Browse the repository at this point in the history
  • Loading branch information
NewSoupVi committed Aug 8, 2024
1 parent 95110c4 commit 9103485
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions worlds/witness/hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,20 @@ def word_area_hint(world: "WitnessWorld", hinted_area: str, corresponding_items:
any local lasers to be found in this area.
"""

local_progression = sum(item.player == world.player and item.advancement for item in corresponding_items)
non_local_progression = sum(item.player != world.player and item.advancement for item in corresponding_items)
local_progression = sum(
item is not None and item.player == world.player and item.advancement
for item in corresponding_items
)
non_local_progression = sum(
item is not None and item.player != world.player and item.advancement
for item in corresponding_items
)

laser_names = {"Symmetry Laser", "Desert Laser", "Quarry Laser", "Shadows Laser", "Town Laser", "Monastery Laser",
"Jungle Laser", "Bunker Laser", "Swamp Laser", "Treehouse Laser", "Keep Laser", }

local_lasers = sum(
item.player == world.player and item.name in laser_names
item is not None and item.player == world.player and item.name in laser_names
for item in corresponding_items
)

Expand Down

0 comments on commit 9103485

Please sign in to comment.