From 679cb3e197aa5c6def04cce82476ee8c26179f34 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 21 Nov 2022 19:30:45 +0100 Subject: [PATCH] Factorio: fix revealed tech tree hinting old location names --- worlds/factorio/__init__.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/worlds/factorio/__init__.py b/worlds/factorio/__init__.py index 71103e7c..0053a016 100644 --- a/worlds/factorio/__init__.py +++ b/worlds/factorio/__init__.py @@ -179,6 +179,10 @@ class Factorio(World): "logistics": 1, "rocket-silo": -1} loc: FactorioScienceLocation + if self.multiworld.tech_tree_information[player] == TechTreeInformation.option_full: + # mark all locations as pre-hinted + for loc in self.locations: + loc.revealed = True if self.skip_silo: removed = useless_technologies | {"rocket-silo"} else: @@ -201,11 +205,15 @@ class Factorio(World): if map_basic_settings.get("seed", None) is None: # allow seed 0 map_basic_settings["seed"] = self.multiworld.slot_seeds[player].randint(0, 2 ** 32 - 1) # 32 bit uint - if self.multiworld.tech_tree_information[player] == TechTreeInformation.option_full: - # mark all locations as pre-hinted - self.multiworld.start_location_hints[self.player].value.update(base_tech_table) - for loc in self.locations: + start_location_hints: typing.Set[str] = self.multiworld.start_location_hints[self.player].value + + for loc in self.locations: + # show start_location_hints ingame + if loc.name in start_location_hints: loc.revealed = True + # make spoiler match mod info + elif loc.revealed: + start_location_hints.add(loc.name) def collect_item(self, state, item, remove=False): if item.advancement and item.name in progressive_technology_table: