diff --git a/NewWorldCompanion.Services/NewWorldDataStore.cs b/NewWorldCompanion.Services/NewWorldDataStore.cs index 7de709c..ad62ef7 100644 --- a/NewWorldCompanion.Services/NewWorldDataStore.cs +++ b/NewWorldCompanion.Services/NewWorldDataStore.cs @@ -619,18 +619,18 @@ public bool IsNamedItem(string itemName) { return false; } - else + else if(localisationIds.Count() > 1) { _logger.LogWarning($"Item: {itemName} is not unique. There are {localisationIds.Count()} entries found"); } // Check all similar named items. If one of them is not "named" return false. - // Workaround need for weapon and resource that both share the name "Flint". + // Workaround needed for weapon and resource that both share the name "Flint". bool uniqueNamedItem = true; foreach (var localisationId in localisationIds) { var item = _masterItemDefinitionsJson.FirstOrDefault(i => i.Name.Equals($"@{localisationId.Key}", StringComparison.OrdinalIgnoreCase)); - if (!item.ItemClass.Contains("Named")) + if (!item?.ItemClass.Contains("Named") ?? true) { uniqueNamedItem = false; } @@ -638,7 +638,7 @@ public bool IsNamedItem(string itemName) return uniqueNamedItem; } - public string GetItemId(string itemName)// + public string GetItemId(string itemName) { var localisationId = _itemDefinitionsLocalisation.FirstOrDefault(x => x.Value.Replace("\\n", " ").Equals(itemName, StringComparison.OrdinalIgnoreCase)).Key; MasterItemDefinitionsJson? item = _masterItemDefinitionsJson.FirstOrDefault(i => i.Name.Equals($"@{localisationId}", StringComparison.OrdinalIgnoreCase)); diff --git a/NewWorldCompanion/common.props b/NewWorldCompanion/common.props index d7f8457..28ac5ac 100644 --- a/NewWorldCompanion/common.props +++ b/NewWorldCompanion/common.props @@ -1,7 +1,7 @@ - 1.0.12.4 - 1.0.12.4 + 1.0.12.5 + 1.0.12.5 Copyright © 2023 net6.0-windows diff --git a/readme/newworldcompanion.xcf b/readme/newworldcompanion.xcf new file mode 100644 index 0000000..5938763 Binary files /dev/null and b/readme/newworldcompanion.xcf differ