Only log not found blocks

This commit is contained in:
mm00
2025-05-09 16:46:03 +02:00
parent eb76262e42
commit 3657d34746

View File

@@ -140,7 +140,8 @@ public class Reader {
blockOffset += t.GetCustomAttribute<DNAClassAttribute>()!.Size;
}
}
foreach (var obj in objects) {
for(int i=0; i<Objects.Count; i++) {
var obj = Objects.ElementAt(i);
// for each converted object
// get the fields of the object
FieldInfo[] fieldInfo = obj.Value.GetType().GetFields();
@@ -167,7 +168,15 @@ public class Reader {
{
newobj = ActivateInstance(f.FieldType);
if (newobj != null) {
try
{
FillObject(addr, ref newobj, f.FieldType.GetFields());
} catch (Exception e)
{
Console.WriteLine($"Error while filling object {f.FieldType.Name}: {e}");
continue;
}
f.SetValue(obj.Value, newobj);
} // should never happen
else throw new NotSupportedException($"Type \"{f.FieldType}\" is unknown");