From 5b76c63393dee49087b5f91d44b3b73d1d05ba3f Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Mon, 2 Sep 2024 00:20:29 +0100 Subject: [PATCH] Fix the converter trying to appoint invalid married court chaplains (#2127) #patch --- ImperatorToCK3/CK3/Titles/Title.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ImperatorToCK3/CK3/Titles/Title.cs b/ImperatorToCK3/CK3/Titles/Title.cs index b4b859753..0d133ff79 100644 --- a/ImperatorToCK3/CK3/Titles/Title.cs +++ b/ImperatorToCK3/CK3/Titles/Title.cs @@ -1357,11 +1357,19 @@ private void AppointCouncilMembersFromImperator(ReligionCollection religionColle if (rulerFaithId is null || rulerFaithId != ck3Official.GetFaithId(bookmarkDate)) { continue; } + + // If the faith has Disallowed Clerical Marriage, don't allow married court chaplains. + var rulerFaith = religionCollection.GetFaith(rulerFaithId); + if (rulerFaith?.HasDoctrine("doctrine_clerical_marriage_disallowed") == true) { + if (ck3Official.GetSpouseIds(bookmarkDate).Count > 0) { + continue; + } + } // If the court faith has doctrine_theocracy_temporal (Theocratic Clerical Tradition), the court chaplain should // be either theocratic or landless. // For the purpose of the conversion, we simply require them to be landless. - if (religionCollection.GetFaith(rulerFaithId)?.HasDoctrine("doctrine_theocracy_temporal") == true) { + if (rulerFaith?.HasDoctrine("doctrine_theocracy_temporal") == true) { if (heldTitlesCount > 0) { continue; }