Skip to content

Commit

Permalink
This is better I think
Browse files Browse the repository at this point in the history
  • Loading branch information
NewSoupVi committed Jan 27, 2024
1 parent 59450f3 commit 26bab77
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions worlds/witness/hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,17 +652,12 @@ def create_all_hints(world: "WitnessWorld", hint_amount: int, area_hints: int) -
remaining_location_hints = intended_location_hints - always_hints_to_use
priority_hints_to_use = int(max(0.0, min(possible_priority_hints / 2, remaining_location_hints / 2)))

amt_of_used_always_hints = 0
amt_of_used_priority_hints = 0

for _ in range(always_hints_to_use):
amt_of_used_always_hints += 1
location_hint = always_hints.pop()
generated_hints.append(word_direct_hint(world, location_hint))
already_hinted_locations.add(location_hint.location)

for _ in range(priority_hints_to_use):
amt_of_used_priority_hints += 1
location_hint = priority_hints.pop()
generated_hints.append(word_direct_hint(world, location_hint))
already_hinted_locations.add(location_hint.location)
Expand All @@ -680,6 +675,10 @@ def create_all_hints(world: "WitnessWorld", hint_amount: int, area_hints: int) -
if len(generated_hints) < hint_amount:
remaining_needed_location_hints = hint_amount - len(generated_hints)

# Save old values for used always and priority hints for later calculations
amt_of_used_always_hints = always_hints_to_use
amt_of_used_priority_hints = priority_hints_to_use

# Recalculate how many always hints and priority hints are supposed to be used
intended_location_hints = remaining_needed_location_hints + location_hints_created_in_round_1

Expand Down

0 comments on commit 26bab77

Please sign in to comment.