This commit is contained in:
2025-12-13 16:08:37 +01:00
parent 0b16efc4be
commit efa6016fe5
2 changed files with 14 additions and 2 deletions

13
Main.cs
View File

@@ -2144,8 +2144,17 @@ namespace KCM
{
Assembly assembly = typeof(Building).Assembly;
var types = assembly
.GetTypes()
Type[] allTypes;
try
{
allTypes = assembly.GetTypes();
}
catch (ReflectionTypeLoadException e)
{
allTypes = e.Types.Where(t => t != null).ToArray();
}
var types = allTypes
.Where(t => t != null && typeof(Building).IsAssignableFrom(t) && !t.IsAbstract)
.ToArray();