mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Stardew Valley: Precollect building items in deterministic order (#4883)
#4239 refactored buildings, but introduced iteration of a set when precollecting the building items into start inventory. The iteration order of sets varies between separate Python processes due to set order being partially based on the hashes of the objects in the set and because Python processes each have a random hash seed by default.
This commit is contained in:
@@ -206,7 +206,8 @@ class StardewValleyWorld(World):
|
||||
if not building_progression.is_progressive:
|
||||
return
|
||||
|
||||
for building in building_progression.starting_buildings:
|
||||
# starting_buildings is a set, so sort for deterministic order.
|
||||
for building in sorted(building_progression.starting_buildings):
|
||||
item, quantity = building_progression.to_progressive_item(building)
|
||||
for _ in range(quantity):
|
||||
self.multiworld.push_precollected(self.create_item(item))
|
||||
|
Reference in New Issue
Block a user