From 1f6dc85962e4032e077750eeca3c8cb7df471b00 Mon Sep 17 00:00:00 2001 From: iht Date: Mon, 6 Jan 2025 21:30:01 +0100 Subject: [PATCH] Fixup for unreformed faiths without reformed_icon --- ImperatorToCK3/CK3/Religions/Faith.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ImperatorToCK3/CK3/Religions/Faith.cs b/ImperatorToCK3/CK3/Religions/Faith.cs index 8d769b394..7c792e318 100644 --- a/ImperatorToCK3/CK3/Religions/Faith.cs +++ b/ImperatorToCK3/CK3/Religions/Faith.cs @@ -24,6 +24,13 @@ public Faith(string id, FaithData faithData, Religion religion) { DoctrineIds = faithData.DoctrineIds.ToOrderedSet(); holySiteIds = faithData.HolySiteIds.ToOrderedSet(); attributes = [.. faithData.Attributes]; + + // Fixup for issue found in TFE: add reformed_icon if faith has unreformed_faith_doctrine. + if (DoctrineIds.Contains("unreformed_faith_doctrine") && !attributes.Any(pair => pair.Key == "reformed_icon")) { + // Use the icon attribute. + var icon = attributes.FirstOrDefault(pair => pair.Key == "icon"); + attributes = [.. attributes, new KeyValuePair("reformed_icon", icon.Value)]; + } } private readonly OrderedSet holySiteIds;