Skip to content

Commit

Permalink
Fix disallow_random_traits being specified twice for some characters (
Browse files Browse the repository at this point in the history
#1814) #major
  • Loading branch information
IhateTrains authored Mar 7, 2024
1 parent 6c54f18 commit 76d1621
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ImperatorToCK3/Outputter/CharacterOutputter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 76d1621

Please sign in to comment.