From 9bb9f5640add59f988a6b9d78ac6641cd3fc0df9 Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Wed, 27 Dec 2023 17:31:10 +0100 Subject: [PATCH] Temporary fix for broken Invictus DNA strings (#1669) #patch Sentry event: d7000a22c8974f3993523b34db30aa2b --- ImperatorToCK3/Imperator/Characters/PortraitData.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ImperatorToCK3/Imperator/Characters/PortraitData.cs b/ImperatorToCK3/Imperator/Characters/PortraitData.cs index b217f7332..9d7a2d113 100644 --- a/ImperatorToCK3/Imperator/Characters/PortraitData.cs +++ b/ImperatorToCK3/Imperator/Characters/PortraitData.cs @@ -83,6 +83,12 @@ public PortraitData(string dnaString, GenesDB genesDB, string ageSexString = "ma continue; } + // Temporary fix for broken Invictus DNA strings which don't have a value for the headgear gene. + // TODO: verify if still require for Invictus version higher than the original pre-hotfix 1.7 + if (gene.Id == "headgear") { + continue; + } + var geneTemplateByteIndex = geneIndex.Value * 4; var geneTemplateIndex = (uint)decodedDnaStr[geneTemplateByteIndex]; var geneTemplateRecessiveIndex = (uint)decodedDnaStr[geneTemplateByteIndex + 2];