diff --git a/TShockAPI/FileTools.cs b/TShockAPI/FileTools.cs index ab12a475..9c52847b 100644 --- a/TShockAPI/FileTools.cs +++ b/TShockAPI/FileTools.cs @@ -210,14 +210,17 @@ namespace TShockAPI internal static TSettings LoadConfigAndCheckForMissingFields(JObject jObject, out bool anyMissingFields) where TSettings : new() { anyMissingFields = false; - var configFields = new HashSet(typeof(Configuration.ConfigFile).GetFields() + + var configFields = new HashSet(typeof(TSettings).GetFields() .Where(field => !field.IsStatic) .Select(field => field.Name)); - var jsonFields = new HashSet(jObject + + var jsonFields = new HashSet(jObject.SelectToken("Settings") .Children() .Select(field => field as JProperty) .Where(field => field != null) .Select(field => field.Name)); + anyMissingFields = !configFields.SetEquals(jsonFields); return jObject.SelectToken("Settings").ToObject();