diff --git a/EXILED/Exiled.Loader/Config.cs b/EXILED/Exiled.Loader/Config.cs index 4e720d7bb7..6e07979ef2 100644 --- a/EXILED/Exiled.Loader/Config.cs +++ b/EXILED/Exiled.Loader/Config.cs @@ -88,11 +88,5 @@ public sealed class Config : IConfig /// [Description("Indicates whether Exiled should auto-update itself as soon as a new release is available.")] public bool EnableAutoUpdates { get; set; } = true; - - /// - /// Gets or sets a value indicating whether config validator should check all properties inside config values' types. - /// - [Description("Indicating whether config validator should check all properties inside config values' types.")] - public bool EnableDeepValidation { get; set; } = false; } } \ No newline at end of file diff --git a/EXILED/Exiled.Loader/ConfigManager.cs b/EXILED/Exiled.Loader/ConfigManager.cs index ac52381049..84399b0b7b 100644 --- a/EXILED/Exiled.Loader/ConfigManager.cs +++ b/EXILED/Exiled.Loader/ConfigManager.cs @@ -147,16 +147,16 @@ public static void ValidateType(object instance, object defaultInstance, Propert return; } - if (hasValidateChildrenAttribute || (!LoaderPlugin.Config.EnableDeepValidation && !(propertyInfo.PropertyType.Namespace?.Contains("System") ?? false))) + if (!hasValidateChildrenAttribute) + return; + + foreach (PropertyInfo property in propertyInfo.PropertyType.GetProperties().Where(x => x.GetMethod != null && x.SetMethod != null)) { - foreach (PropertyInfo property in propertyInfo.PropertyType.GetProperties().Where(x => x.GetMethod != null && x.SetMethod != null)) - { - ConstructorInfo ctor = property.PropertyType.GetConstructor(Type.EmptyTypes); - if (ctor is null) - continue; + ConstructorInfo ctor = property.PropertyType.GetConstructor(Type.EmptyTypes); + if (ctor is null) + continue; - ValidateType(value, ctor.Invoke(null, null), property, ref validated); - } + ValidateType(value, ctor.Invoke(null, null), property, ref validated); } }