SC2: Fix Nondeterministic Behavior (#4246)
* Add < for sorting * Sorting for determinism * id instead of value
This commit is contained in:
parent
a650e90b57
commit
e6e31a27e6
|
@ -43,6 +43,9 @@ class SC2Campaign(Enum):
|
||||||
self.goal_priority = goal_priority
|
self.goal_priority = goal_priority
|
||||||
self.race = race
|
self.race = race
|
||||||
|
|
||||||
|
def __lt__(self, other: "SC2Campaign"):
|
||||||
|
return self.id < other.id
|
||||||
|
|
||||||
GLOBAL = 0, "Global", SC2CampaignGoalPriority.NONE, SC2Race.ANY
|
GLOBAL = 0, "Global", SC2CampaignGoalPriority.NONE, SC2Race.ANY
|
||||||
WOL = 1, "Wings of Liberty", SC2CampaignGoalPriority.VERY_HARD, SC2Race.TERRAN
|
WOL = 1, "Wings of Liberty", SC2CampaignGoalPriority.VERY_HARD, SC2Race.TERRAN
|
||||||
PROPHECY = 2, "Prophecy", SC2CampaignGoalPriority.MINI_CAMPAIGN, SC2Race.PROTOSS
|
PROPHECY = 2, "Prophecy", SC2CampaignGoalPriority.MINI_CAMPAIGN, SC2Race.PROTOSS
|
||||||
|
|
|
@ -50,7 +50,7 @@ def create_vanilla_regions(
|
||||||
names: Dict[str, int] = {}
|
names: Dict[str, int] = {}
|
||||||
|
|
||||||
# Generating all regions and locations for each enabled campaign
|
# 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():
|
for region_name in vanilla_mission_req_table[campaign].keys():
|
||||||
regions.append(create_region(world, locations_per_region, location_cache, region_name))
|
regions.append(create_region(world, locations_per_region, location_cache, region_name))
|
||||||
world.multiworld.regions += regions
|
world.multiworld.regions += regions
|
||||||
|
|
Loading…
Reference in New Issue