Skip to content

Commit

Permalink
Prevent exception when generating eremitic holder for c_faereyar (#1554
Browse files Browse the repository at this point in the history
…) #patch
  • Loading branch information
IhateTrains authored Oct 10, 2023
1 parent 9579bda commit d5d5a33
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ImperatorToCK3/CK3/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,15 @@ private void HandleIcelandAndFaroeIslands(Configuration config) {
Logger.Debug($"Generating hermit for {titleId}...");

var hermit = new Character($"IRToCK3_{titleId}_hermit", namePool.Dequeue(), bookmarkDate.ChangeByYears(-50), Characters);
var faithId = faithCandidates.First(c => faiths.Any(f => f.Id == c));
hermit.SetFaithId(faithId, null);
hermit.SetCultureId(cultureId, null);
hermit.History.AddFieldValue(null, "traits", "trait", "chaste");
hermit.History.AddFieldValue(null, "traits", "trait", "celibate");
hermit.History.AddFieldValue(null, "traits", "trait", "devoted");
var faithId = faithCandidates.First(c => faiths.Exists(f => f.Id == c));
hermit.SetFaithId(faithId, date: null);
hermit.SetCultureId(cultureId, date: null);
hermit.History.AddFieldValue(date: null, "traits", "trait", "chaste");
hermit.History.AddFieldValue(date: null, "traits", "trait", "celibate");
hermit.History.AddFieldValue(date: null, "traits", "trait", "devoted");
var eremiteEffect = new StringOfItem("{ set_variable = IRToCK3_eremite_flag }");
hermit.History.AddFieldValue(config.CK3BookmarkDate, "effects", "effect", eremiteEffect);
Characters.Add(hermit);
Characters.AddOrReplace(hermit);

title.SetHolder(hermit, bookmarkDate);
title.SetGovernment("eremitic_government", bookmarkDate);
Expand Down

0 comments on commit d5d5a33

Please sign in to comment.