monkeyman192 / MBINCompiler

A tool for decompiling No Man's Sky .MBIN files to XML format
https://monkeyman192.github.io/MBINCompiler
Other
253 stars 50 forks source link

omiting VariableSizeString Linked property in LinkableNMSTemplate throws an error instead of re-adding a default value. #612

Open roie-r opened 4 months ago

roie-r commented 4 months ago

I noticed a minor oddity with the new LinkableNMSTemplate class (present in TkAttachmentData > Components) If you omit Linked property, instead of re-adding it with a default value like other string properties elsewhere, the process throws an error... it's different behavior from other properties.

ERR INFO: at libMBIN.NMSTemplate.SerializeValue(BinaryWriter writer, Type fieldType, Object fieldData, NMSAttribute settings, FieldInfo field, List1& additionalData, Int32& addtDataIndex, UInt32 listEnding, Byte paddingByte) at libMBIN.NMSTemplate.AppendToWriter(BinaryWriter writer, List1& additionalData, Int32& addtDataIndex, Type parent, UInt32 listEnding, Byte paddingByte) at libMBIN.NMSTemplate.SerializeValue(BinaryWriter writer, Type fieldType, Object fieldData, NMSAttribute settings, FieldInfo field, List1& additionalData, Int32& addtDataIndex, UInt32 listEnding, Byte paddingByte) at libMBIN.NMSTemplate.SerializeList(BinaryWriter writer, IList list, Int64 listHeaderPosition, List1& additionalData, Int32 addtDataIndex, UInt32 listEnding, Byte paddingByte, Boolean writingHashMap) at libMBIN.NMSTemplate.SerializeBytes() at libMBIN.MBINFile.SetData(NMSTemplate template) at MBINCompiler.Commands.Convert.ConvertEXML(String inputPath, FileStream fIn, MemoryStream msOut, String fileOut)