From 360a1384f290ddfbed737390f55a89fb16c97599 Mon Sep 17 00:00:00 2001 From: Carter Hesterman Date: Sat, 29 Nov 2025 11:02:15 -0700 Subject: [PATCH] Civ6: Fix issue with names including civ-breaking characters (#5204) --- worlds/civ_6/Container.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/worlds/civ_6/Container.py b/worlds/civ_6/Container.py index a5790c1ec4..433145f42f 100644 --- a/worlds/civ_6/Container.py +++ b/worlds/civ_6/Container.py @@ -44,9 +44,10 @@ class CivVIContainer(APPlayerContainer): opened_zipfile.writestr(filename, yml) super().write_contents(opened_zipfile) + def sanitize_value(value: str) -> str: - """Removes values that can cause issues in XML""" - return value.replace('"', "'").replace('&', 'and') + """Removes values that can cause issues in XML""" + return value.replace('"', "'").replace('&', 'and').replace('{', '').replace('}', '') def get_cost(world: 'CivVIWorld', location: CivVILocationData) -> int: @@ -87,8 +88,10 @@ def generate_new_items(world: 'CivVIWorld') -> str: boost_civics = [] if world.options.boostsanity: - boost_techs = [location for location in locations if location.location_type == CivVICheckType.BOOST and location.name.split("_")[1] == "TECH"] - boost_civics = [location for location in locations if location.location_type == CivVICheckType.BOOST and location.name.split("_")[1] == "CIVIC"] + boost_techs = [location for location in locations if location.location_type == + CivVICheckType.BOOST and location.name.split("_")[1] == "TECH"] + boost_civics = [location for location in locations if location.location_type == + CivVICheckType.BOOST and location.name.split("_")[1] == "CIVIC"] techs += boost_techs civics += boost_civics