From 0f034ddcf7ecd6e47a002f5f85cb3c41bdcebd32 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Thu, 3 Nov 2022 00:15:04 +0100 Subject: [PATCH] Factorio: make client use CommonClient location lookup for technologies --- FactorioClient.py | 3 +-- worlds/factorio/Technologies.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/FactorioClient.py b/FactorioClient.py index cd6e22c1..19150ca2 100644 --- a/FactorioClient.py +++ b/FactorioClient.py @@ -195,7 +195,6 @@ class FactorioContext(CommonContext): async def game_watcher(ctx: FactorioContext): bridge_logger = logging.getLogger("FactorioWatcher") - from worlds.factorio.Technologies import lookup_id_to_name next_bridge = time.perf_counter() + 1 try: while not ctx.exit_event.is_set(): @@ -226,7 +225,7 @@ async def game_watcher(ctx: FactorioContext): if ctx.locations_checked != research_data: bridge_logger.debug( f"New researches done: " - f"{[lookup_id_to_name[rid] for rid in research_data - ctx.locations_checked]}") + f"{[ctx.location_names[rid] for rid in research_data - ctx.locations_checked]}") ctx.locations_checked = research_data await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": tuple(research_data)}]) death_link_tick = data.get("death_link_tick", 0) diff --git a/worlds/factorio/Technologies.py b/worlds/factorio/Technologies.py index 09f9fc93..2db7f23d 100644 --- a/worlds/factorio/Technologies.py +++ b/worlds/factorio/Technologies.py @@ -445,8 +445,6 @@ common_tech_table: Dict[str, int] = {tech_name: tech_id for tech_name, tech_id i useless_technologies: Set[str] = {tech_name for tech_name in common_tech_table if not technology_table[tech_name].useful()} -lookup_id_to_name: Dict[int, str] = {item_id: item_name for item_name, item_id in tech_table.items()} - rel_cost = { "wood": 10000, "iron-ore": 1,