diff --git a/Mutagen.Bethesda.Fallout4/Records/Major Records/ObjectModification.cs b/Mutagen.Bethesda.Fallout4/Records/Major Records/ObjectModification.cs index da72cd575..8c792980b 100644 --- a/Mutagen.Bethesda.Fallout4/Records/Major Records/ObjectModification.cs +++ b/Mutagen.Bethesda.Fallout4/Records/Major Records/ObjectModification.cs @@ -51,14 +51,21 @@ public static AObjectModification CreateFromBinary( } } var type = new RecordType(BinaryPrimitives.ReadInt32LittleEndian(data.Content.Slice(10))); - return type.TypeInt switch + switch (type.TypeInt) { - RecordTypeInts.ARMO => ArmorModification.CreateFromBinary(frame), - RecordTypeInts.NPC_ => NpcModification.CreateFromBinary(frame), - RecordTypeInts.WEAP => WeaponModification.CreateFromBinary(frame), - RecordTypeInts.NONE => ObjectModification.CreateFromBinary(frame), - _ => UnknownObjectModification.CreateFromBinary(frame), - }; + case RecordTypeInts.ARMO: + return ArmorModification.CreateFromBinary(frame); + case RecordTypeInts.NPC_: + return NpcModification.CreateFromBinary(frame); + case RecordTypeInts.WEAP: + return WeaponModification.CreateFromBinary(frame); + case RecordTypeInts.NONE: + return ObjectModification.CreateFromBinary(frame); + default: + var unknown = UnknownObjectModification.CreateFromBinary(frame); + unknown.ModificationType = type; + return unknown; + } } catch (Exception e) {