From 691ce6a248915a7bb1b22006dddc20addd87489b Mon Sep 17 00:00:00 2001 From: Mysteryem Date: Fri, 6 Sep 2024 18:23:16 +0100 Subject: [PATCH] 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. --- worlds/witness/entity_hunt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 34cf7d3d..86881930 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -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])