From 76d162103e659424ad1b74ae03cb2e25c0d126c9 Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Thu, 7 Mar 2024 21:42:09 +0100 Subject: [PATCH] Fix `disallow_random_traits` being specified twice for some characters (#1814) #major --- ImperatorToCK3/Outputter/CharacterOutputter.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ImperatorToCK3/Outputter/CharacterOutputter.cs b/ImperatorToCK3/Outputter/CharacterOutputter.cs index 8c487a07b..ead34a853 100644 --- a/ImperatorToCK3/Outputter/CharacterOutputter.cs +++ b/ImperatorToCK3/Outputter/CharacterOutputter.cs @@ -10,13 +10,15 @@ public static void OutputCharacter(TextWriter output, Character character, Date // Output ID. output.WriteLine($"{character.Id}={{"); - // Don't output traits and attributes of dead characters (not needed). if (character.Dead) { + // Don't output traits and attributes of dead characters (not needed). var fieldsToRemove = new[] {"traits", "employer", "diplomacy", "martial", "stewardship", "intrigue", "learning"}; foreach (var field in fieldsToRemove) { character.History.Fields.Remove(field); } - output.WriteLine("\tdisallow_random_traits=yes"); + + // Disallow random traits for dead characters. + character.History.AddFieldValue(null, "disallow_random_traits", "disallow_random_traits", "yes"); } // Add DNA to history.