Factorio: make client use CommonClient location lookup for technologies

This commit is contained in:
Fabian Dill 2022-11-03 00:15:04 +01:00 committed by Fabian Dill
parent 7f3eda4623
commit 0f034ddcf7
2 changed files with 1 additions and 4 deletions

View File

@ -195,7 +195,6 @@ class FactorioContext(CommonContext):
async def game_watcher(ctx: FactorioContext): async def game_watcher(ctx: FactorioContext):
bridge_logger = logging.getLogger("FactorioWatcher") bridge_logger = logging.getLogger("FactorioWatcher")
from worlds.factorio.Technologies import lookup_id_to_name
next_bridge = time.perf_counter() + 1 next_bridge = time.perf_counter() + 1
try: try:
while not ctx.exit_event.is_set(): while not ctx.exit_event.is_set():
@ -226,7 +225,7 @@ async def game_watcher(ctx: FactorioContext):
if ctx.locations_checked != research_data: if ctx.locations_checked != research_data:
bridge_logger.debug( bridge_logger.debug(
f"New researches done: " 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 ctx.locations_checked = research_data
await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": tuple(research_data)}]) await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": tuple(research_data)}])
death_link_tick = data.get("death_link_tick", 0) death_link_tick = data.get("death_link_tick", 0)

View File

@ -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 useless_technologies: Set[str] = {tech_name for tech_name in common_tech_table
if not technology_table[tech_name].useful()} 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 = { rel_cost = {
"wood": 10000, "wood": 10000,
"iron-ore": 1, "iron-ore": 1,