The Witness: Fix nondeterministic entity hunt (#3892)

In `_get_next_random_batch()`, the `remaining_entities` and
`remaining_entity_weights` lists were being constructed by iterating
sets.

This patch changes the function to iterate a sorted copy of each set
instead.
This commit is contained in:
Mysteryem 2024-09-06 18:23:16 +01:00 committed by GitHub
parent f9fc6944d3
commit 691ce6a248
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ class EntityHuntPicker:
remaining_entities, remaining_entity_weights = [], []
for area, eligible_entities in self.ELIGIBLE_ENTITIES_PER_AREA.items():
for panel in eligible_entities - self.HUNT_ENTITIES:
for panel in sorted(eligible_entities - self.HUNT_ENTITIES):
remaining_entities.append(panel)
remaining_entity_weights.append(allowance_per_area[area])