From b11faab72d44de59e721e434144fdfa394bf8368 Mon Sep 17 00:00:00 2001 From: Seweryn Presnal Date: Sun, 8 Sep 2024 18:44:30 +0200 Subject: [PATCH] Fix outputted CoAs causing an error in error.log --- ImperatorToCK3/Outputter/CoatOfArmsOutputter.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ImperatorToCK3/Outputter/CoatOfArmsOutputter.cs b/ImperatorToCK3/Outputter/CoatOfArmsOutputter.cs index 4e1da0e5f..e5013ca06 100644 --- a/ImperatorToCK3/Outputter/CoatOfArmsOutputter.cs +++ b/ImperatorToCK3/Outputter/CoatOfArmsOutputter.cs @@ -23,9 +23,16 @@ public static async Task OutputCoas(string outputModPath, Title.LandedTitles tit // Output CoAs for titles. foreach (var title in titles) { var coa = title.CoA; - if (coa is not null) { - sb.AppendLine($"{title.Id}={coa}"); + if (coa is null) { + continue; } + + // If the title's ID is present in CoaMapper, we don't need to output the CoA (because it's already in the CK3 mod filesystem). + if (ck3CoaMapper.GetCoaForFlagName(title.Id) is not null) { + continue; + } + + sb.AppendLine($"{title.Id}={coa}"); } // Output CoAs for dynasties.