From 907f9efff376672a54a9661c71b49819bf2845f2 Mon Sep 17 00:00:00 2001 From: Seweryn Presnal Date: Sun, 1 Sep 2024 18:48:29 +0200 Subject: [PATCH] Fix dynasty referenced in character history being purged --- ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs | 5 +++++ .../Data_Files/configurables/ck3_characters_to_preserve.txt | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs b/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs index f836fc38e..e6b587060 100644 --- a/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs +++ b/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs @@ -103,6 +103,11 @@ public void PurgeUnneededDynasties(CharacterCollection characters, HouseCollecti HashSet dynastiesToKeep = []; foreach (var character in characters) { + var dynastyIdAtBirth = character.GetDynastyId(character.BirthDate); + if (dynastyIdAtBirth is not null) { + dynastiesToKeep.Add(dynastyIdAtBirth); + } + var dynastyId = character.GetDynastyId(date); if (dynastyId is not null) { dynastiesToKeep.Add(dynastyId); diff --git a/ImperatorToCK3/Data_Files/configurables/ck3_characters_to_preserve.txt b/ImperatorToCK3/Data_Files/configurables/ck3_characters_to_preserve.txt index 1cf313204..8b8c0bdb4 100644 --- a/ImperatorToCK3/Data_Files/configurables/ck3_characters_to_preserve.txt +++ b/ImperatorToCK3/Data_Files/configurables/ck3_characters_to_preserve.txt @@ -47,7 +47,6 @@ additional_fatimids_1 522 40605 159137 -109607 6878 107590