Skip to content

Commit

Permalink
Fixup for unreformed faiths without reformed_icon
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains committed Jan 6, 2025
1 parent 6e58d30 commit 1f6dc85
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ImperatorToCK3/CK3/Religions/Faith.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, StringOfItem>("reformed_icon", icon.Value)];
}
}

private readonly OrderedSet<string> holySiteIds;
Expand Down

0 comments on commit 1f6dc85

Please sign in to comment.