Core: call stages in sorted order (#1791)

This commit is contained in:
Fabian Dill 2023-05-04 14:14:20 +02:00 committed by GitHub
parent a0464ecea1
commit 11b2b5ed2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -98,9 +98,7 @@ def call_all(multiworld: "MultiWorld", method_name: str, *args: Any) -> None:
f"Duplicate item reference of \"{item.name}\" in \"{multiworld.worlds[player].game}\" "
f"of player \"{multiworld.player_name[player]}\". Please make a copy instead.")
# TODO: investigate: Iterating through a set is not a deterministic order.
# If any random is used, this could make unreproducible seed.
for world_type in world_types:
for world_type in sorted(world_types, key=lambda world: world.__name__):
stage_callable = getattr(world_type, f"stage_{method_name}", None)
if stage_callable:
stage_callable(multiworld, *args)