-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
special_headgear_blindfold
gene is not found (#…
…2397) #patch Sentry event ID: 2454b92b077e42088ba9b3e3e777f5b3 Issue seems to occur when EPE is included in the CK3 mods.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,8 @@ internal DNA GenerateDNA(Imperator.Characters.Character irCharacter, PortraitDat | |
} | ||
|
||
// Convert eye accessories. | ||
const string blindfoldGeneId = "special_headgear_blindfold"; | ||
const string blindfoldTemplateId = "blindfold"; | ||
var irEyeAccessoryGeneTemplateName = irPortraitData.AccessoryGenesDict["eye_accessory"].GeneTemplate; | ||
switch (irEyeAccessoryGeneTemplateName) { | ||
case "normal_eyes": | ||
|
@@ -171,11 +173,18 @@ internal DNA GenerateDNA(Imperator.Characters.Character irCharacter, PortraitDat | |
|
||
break; | ||
case "blindfold_1": // TODO: check if this is correctly added to portrait modifiers if needed | ||
Check warning on line 175 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / Upload development build (linux-x64)
Check warning on line 175 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (linux-x64)
Check warning on line 175 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (osx-arm64)
Check warning on line 175 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (win-x64)
Check warning on line 175 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / Upload development build (win-x64)
|
||
var blindfoldTemplate = ck3GenesDB.SpecialAccessoryGenes["special_headgear_blindfold"] | ||
.GeneTemplates["blindfold"]; | ||
if (!ck3GenesDB.SpecialAccessoryGenes.TryGetValue(blindfoldGeneId, out var blindfoldGene)) { | ||
Logger.Warn($"{blindfoldGeneId} not found in CK3 special accessory genes!"); | ||
break; | ||
} | ||
if (!blindfoldGene.GeneTemplates.TryGetValue(blindfoldTemplateId, out var blindfoldTemplate)) { | ||
Logger.Warn($"{blindfoldTemplateId} not found in CK3 special accessory genes!"); | ||
break; | ||
} | ||
|
||
if (blindfoldTemplate.AgeSexWeightBlocks.TryGetValue(irCharacter.AgeSex, out WeightBlock? blindfoldWeightBlock)) { | ||
var blindfoldObjectName = blindfoldWeightBlock.GetMatchingObject(1) ?? blindfoldWeightBlock.ObjectNames.Last(); | ||
accessoryDNAValues["special_headgear_blindfold"] = new(blindfoldTemplate.Id, blindfoldObjectName, blindfoldWeightBlock); | ||
accessoryDNAValues[blindfoldGeneId] = new(blindfoldTemplate.Id, blindfoldObjectName, blindfoldWeightBlock); | ||
} | ||
|
||
break; | ||
|
@@ -206,12 +215,14 @@ internal DNA GenerateDNA(Imperator.Characters.Character irCharacter, PortraitDat | |
var blindEyesObjectName = blindEyesWeighBlock.GetMatchingObject(1) ?? blindEyesWeighBlock.ObjectNames.Last(); | ||
accessoryDNAValues["eye_accessory"] = new(blindEyesTemplate.Id, blindEyesObjectName, blindEyesWeighBlock); // TODO: check if this is correctly added to portrait modifiers if needed | ||
Check warning on line 216 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / Upload development build (linux-x64)
Check warning on line 216 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (linux-x64)
Check warning on line 216 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (osx-arm64)
Check warning on line 216 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (win-x64)
Check warning on line 216 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / Upload development build (win-x64)
|
||
} | ||
|
||
var blindfoldTemplate = ck3GenesDB.SpecialAccessoryGenes["special_headgear_blindfold"] | ||
.GeneTemplates["blindfold"]; | ||
if (blindfoldTemplate.AgeSexWeightBlocks.TryGetValue(irCharacter.AgeSex, out WeightBlock? blindfoldWeighBlock)) { | ||
|
||
if (!ck3GenesDB.SpecialAccessoryGenes.TryGetValue(blindfoldGeneId, out var blindfoldGene)) { | ||
Logger.Warn($"{blindfoldGeneId} not found in CK3 special accessory genes!"); | ||
} else if (!blindfoldGene.GeneTemplates.TryGetValue(blindfoldTemplateId, out var blindfoldTemplate)) { | ||
Logger.Warn($"{blindfoldTemplateId} not found in CK3 special accessory genes!"); | ||
} else if (blindfoldTemplate.AgeSexWeightBlocks.TryGetValue(irCharacter.AgeSex, out WeightBlock? blindfoldWeighBlock)) { | ||
var blindfoldObjectName = blindfoldWeighBlock.GetMatchingObject(1) ?? blindfoldWeighBlock.ObjectNames.Last(); | ||
accessoryDNAValues["special_headgear_blindfold"] = new(blindfoldTemplate.Id, blindfoldObjectName, blindfoldWeighBlock); // TODO: check if this is correctly added to portrait modifiers if needed | ||
accessoryDNAValues[blindfoldGeneId] = new(blindfoldTemplate.Id, blindfoldObjectName, blindfoldWeighBlock); // TODO: check if this is correctly added to portrait modifiers if needed | ||
Check warning on line 225 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / Upload development build (linux-x64)
Check warning on line 225 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (linux-x64)
Check warning on line 225 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (osx-arm64)
Check warning on line 225 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / add_release_archive (win-x64)
Check warning on line 225 in ImperatorToCK3/CK3/Characters/DNAFactory.cs GitHub Actions / Upload development build (win-x64)
|
||
} | ||
} else if (irCharacter.Traits.Contains("one_eyed")) { | ||
var eyePatchTemplate = ck3GenesDB.SpecialAccessoryGenes["special_headgear_eye_patch"] | ||
|