From 61f794b08abf5cb73787357eac32f34d4d44f940 Mon Sep 17 00:00:00 2001 From: Ben C Date: Wed, 13 Apr 2022 14:56:25 -0400 Subject: [PATCH] Fixed Entry IDs not getting registered to _entryIDsToNHBody --- .../Builder/ShipLog/RumorModeBuilder.cs | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs b/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs index 4401e652..64035322 100644 --- a/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs @@ -71,26 +71,32 @@ namespace NewHorizons.Builder.ShipLog { XElement curiosityName = entryElement.Element("Curiosity"); XElement id = entryElement.Element("ID"); - if (curiosityName != null && id != null && _entryIdToRawName.ContainsKey(id.Value) == false) + if (id != null) { entryIDs.Add(id.Value); - _entryIdToRawName.Add(id.Value, curiosityName.Value); + if (curiosityName != null && _entryIdToRawName.ContainsKey(id.Value) == false) + { + _entryIdToRawName.Add(id.Value, curiosityName.Value); + } } foreach (XElement childEntryElement in entryElement.Elements("Entry")) { XElement childCuriosityName = childEntryElement.Element("Curiosity"); XElement childId = childEntryElement.Element("ID"); - if (childId != null && _entryIdToRawName.ContainsKey(childId.Value)) + if (childId != null) { - if (childCuriosityName == null && curiosityName != null) - { - _entryIdToRawName.Add(childId.Value, curiosityName.Value); - } - else if (childCuriosityName != null) - { - _entryIdToRawName.Add(childId.Value, childCuriosityName.Value); - } entryIDs.Add(childId.Value); + if (_entryIdToRawName.ContainsKey(childId.Value)) + { + if (childCuriosityName == null && curiosityName != null) + { + _entryIdToRawName.Add(childId.Value, curiosityName.Value); + } + else if (childCuriosityName != null) + { + _entryIdToRawName.Add(childId.Value, childCuriosityName.Value); + } + } } AddTranslation(childEntryElement); }