diff --git a/ImperatorToCK3/CK3/Titles/LandedTitles.cs b/ImperatorToCK3/CK3/Titles/LandedTitles.cs index ecf7b2189..7a79ade9e 100644 --- a/ImperatorToCK3/CK3/Titles/LandedTitles.cs +++ b/ImperatorToCK3/CK3/Titles/LandedTitles.cs @@ -275,7 +275,7 @@ public void CleanUpHistory(CharacterCollection characters, Date ck3BookmarkDate) } holderField.RemoveAllEntries( - value => value.ToString() is string valStr && valStr != "0" && !validIds.Contains(valStr) + value => value.ToString()?.RemQuotes() is string valStr && valStr != "0" && !validIds.Contains(valStr) ); } @@ -313,7 +313,7 @@ public void CleanUpHistory(CharacterCollection characters, Date ck3BookmarkDate) } var lastEntry = entriesList.Last(); - var liegeTitleId = lastEntry.Value.ToString(); + var liegeTitleId = lastEntry.Value.ToString()?.RemQuotes(); if (liegeTitleId is null || liegeTitleId == "0") { continue; } @@ -324,9 +324,9 @@ public void CleanUpHistory(CharacterCollection characters, Date ck3BookmarkDate) // Instead of removing the liege entry, see if the liege title has a holder at a later date, // and move the liege entry to that date. liegeTitle.History.Fields.TryGetValue("holder", out var liegeHolderField); - Date? laterDate = liegeHolderField?.DateToEntriesDict.Keys - .Where(d => d > date && d <= ck3BookmarkDate) - .Min(); + Date? laterDate = liegeHolderField?.DateToEntriesDict + .Where(kvp => kvp.Value.Count != 0 && kvp.Key > date && kvp.Key <= ck3BookmarkDate) + .Min(kvp => kvp.Key); if (laterDate == null) { liegeField.DateToEntriesDict.Remove(date); diff --git a/ImperatorToCK3/CK3/Titles/Title.cs b/ImperatorToCK3/CK3/Titles/Title.cs index fc195305d..34b45340a 100644 --- a/ImperatorToCK3/CK3/Titles/Title.cs +++ b/ImperatorToCK3/CK3/Titles/Title.cs @@ -751,8 +751,8 @@ public HashSet GetAllHolderIds() { return ids; } public void SetHolder(Character? character, Date date) { - var id = character is null ? "0" : character.Id; - History.AddFieldValue(date, "holder", "holder", id); + var holderId = character is null ? "0" : character.Id; + History.AddFieldValue(date, "holder", "holder", holderId); } public void SetDevelopmentLevel(int value, Date date) { diff --git a/ImperatorToCK3/Data_Files/configurables/dynasties_to_preserve.txt b/ImperatorToCK3/Data_Files/configurables/dynasties_to_preserve.txt index 43a01914d..f1c722ef6 100644 --- a/ImperatorToCK3/Data_Files/configurables/dynasties_to_preserve.txt +++ b/ImperatorToCK3/Data_Files/configurables/dynasties_to_preserve.txt @@ -5,4 +5,12 @@ jamshid 1029100 # Sassanid, referenced in events\dlc\fp3\fp3_struggle_events.txt 613 # Seljuk, referenced in events\yearly_events\yearly_events_persia.txt -25061 # Karling, referenced in common/achievements/standard_achievements.txt \ No newline at end of file +25061 # Karling, referenced in common/achievements/standard_achievements.txt + +# TFE +900021 # referenced in common\scripted_guis\sevenhouses.txt +mihran_dynasty # referenced in common\scripted_guis\sevenhouses.txt +suren_dynasty # referenced in common\scripted_guis\sevenhouses.txt +varaz_dynasty # referenced in common\scripted_guis\sevenhouses.txt +spandiyadh_dynasty # referenced in common\scripted_guis\sevenhouses.txt +7511 # referenced in common\scripted_guis\sevenhouses.txt \ No newline at end of file diff --git a/ImperatorToCK3/Data_Files/configurables/removable_file_blocks_tfe.txt b/ImperatorToCK3/Data_Files/configurables/removable_file_blocks_tfe.txt index 04fb35955..d76ec9e96 100644 --- a/ImperatorToCK3/Data_Files/configurables/removable_file_blocks_tfe.txt +++ b/ImperatorToCK3/Data_Files/configurables/removable_file_blocks_tfe.txt @@ -2362,6 +2362,13 @@ on_TFE_east_asia_start = { { NOT = { title:c_trapani.holder = character:belisarius_001 } } + { + if = { + limit = { character:90028 ?= this } + custom_tooltip = ep3_story_cycle_harrying.3053.b.tt + add_character_flag = hereward_settled_flag + } + } } "common/scripted_triggers/tfe_culture_triggers.txt" = { @@ -5269,6 +5276,21 @@ radagaisus_declare_war_for_target_title_effect = { else = { debug_log = "Failed to find a valid war target for Radagaisus!" } +} + } + + { +goths_flee_effect = { + title:k_visigoths.holder = { + save_scope_as = visigothic_king + } + + scope:visigothic_king = { + trigger_event = { + id = gothic_wars.0015 + days = 1 + } + } } } } @@ -12695,4 +12717,20 @@ steppe.6666 = { { Näcken } +} + +"common\scripted_modifiers\00_faction_modifiers.txt" = { + { + # Keep it while the Calip is alive + modifier = { + add = -1000 + $FACTION_TARGET$ = { + this = character:73683 + any_held_title = { + this = title:k_andalusia + } + } + has_game_rule = dissolution_after_caliph_death + } + } } \ No newline at end of file