mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
SC2: Fix Nondeterministic Behavior (#4246)
* Add < for sorting * Sorting for determinism * id instead of value
This commit is contained in:
@@ -43,6 +43,9 @@ class SC2Campaign(Enum):
|
||||
self.goal_priority = goal_priority
|
||||
self.race = race
|
||||
|
||||
def __lt__(self, other: "SC2Campaign"):
|
||||
return self.id < other.id
|
||||
|
||||
GLOBAL = 0, "Global", SC2CampaignGoalPriority.NONE, SC2Race.ANY
|
||||
WOL = 1, "Wings of Liberty", SC2CampaignGoalPriority.VERY_HARD, SC2Race.TERRAN
|
||||
PROPHECY = 2, "Prophecy", SC2CampaignGoalPriority.MINI_CAMPAIGN, SC2Race.PROTOSS
|
||||
|
@@ -50,7 +50,7 @@ def create_vanilla_regions(
|
||||
names: Dict[str, int] = {}
|
||||
|
||||
# Generating all regions and locations for each enabled campaign
|
||||
for campaign in enabled_campaigns:
|
||||
for campaign in sorted(enabled_campaigns):
|
||||
for region_name in vanilla_mission_req_table[campaign].keys():
|
||||
regions.append(create_region(world, locations_per_region, location_cache, region_name))
|
||||
world.multiworld.regions += regions
|
||||
|
Reference in New Issue
Block a user