diff --git a/ARKBreedingStats/values/Values.cs b/ARKBreedingStats/values/Values.cs index c25c933a..db8624aa 100644 --- a/ARKBreedingStats/values/Values.cs +++ b/ARKBreedingStats/values/Values.cs @@ -200,7 +200,7 @@ public bool LoadModValues(IEnumerable modFilesToLoad, bool throwExceptio string filename = FileService.GetJsonPath(Path.Combine(FileService.ValuesFolder, modFileToLoad)); - if (TryLoadValuesFile(filename, true, false, out ValuesFile modValues, out string modFileErrorMessage)) + if (TryLoadValuesFile(filename, true, false, out var modValues, out var modFileErrorMessage, true)) { modifiedValues.Add(modValues); } diff --git a/ARKBreedingStats/values/ValuesFile.cs b/ARKBreedingStats/values/ValuesFile.cs index d4e718d0..82054992 100644 --- a/ARKBreedingStats/values/ValuesFile.cs +++ b/ARKBreedingStats/values/ValuesFile.cs @@ -96,14 +96,14 @@ protected static ValuesFile LoadValuesFile(string filePath) /// If the mod-values will be used, setModFileName should be true. /// If the file cannot be found or the format is wrong, the file is ignored and no exception is thrown if throwExceptionOnFail is false. /// - protected static bool TryLoadValuesFile(string filePath, bool setModFileName, bool throwExceptionOnFail, out ValuesFile values, out string errorMessage) + protected static bool TryLoadValuesFile(string filePath, bool setModFileName, bool throwExceptionOnFail, out ValuesFile values, out string errorMessage, bool checkIfModPropertyIsExisting = false) { values = null; errorMessage = null; try { values = LoadValuesFile(filePath); - if (string.IsNullOrEmpty(values.mod?.id)) + if (checkIfModPropertyIsExisting && string.IsNullOrEmpty(values.mod?.id)) { errorMessage = $"The mod file\n{filePath}\ndoesn't contains an object \"mod\" or that object doesn't contain a valid entry \"id\". The mod file cannot be loaded until this information is added";