Skip to content

Commit

Permalink
patch for vic3 buggy loc parsing (#541)
Browse files Browse the repository at this point in the history
Co-authored-by: Zemurin <[email protected]>
  • Loading branch information
Zemurin and Zemurin authored Jun 23, 2024
1 parent 1701a86 commit 17d9023
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions EU4ToVic3/Source/V3World/PoliticalManager/Country/Country.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,18 @@ void V3::Country::convertFromEU4Country(const ClayManager& clayManager,
processedData.adjective = sourceCountry->getAdjective();
processedData.adjectivesByLanguage = sourceCountry->getAllAdjectiveLocalizations();

// A patch for localizations containing "'" - vic3 has an issue parsing those in debug mode, better to replace them with ` to avoid this.
std::ranges::replace(processedData.name, '\'', '`');
std::ranges::replace(processedData.adjective, '\'', '`');
for (const auto& language: processedData.namesByLanguage | std::views::keys)
{
std::ranges::replace(processedData.namesByLanguage[language], '\'', '`');
}
for (const auto& language: processedData.adjectivesByLanguage | std::views::keys)
{
std::ranges::replace(processedData.adjectivesByLanguage[language], '\'', '`');
}

// TODO: UNTESTED - TESTS IF POSSIBLE WHEN CONVERSION DONE

// Capital
Expand Down

0 comments on commit 17d9023

Please sign in to comment.