lastbattle / Harepacker-resurrected

All in one .wz file/map editor for MapleStory game files
Mozilla Public License 2.0
416 stars 156 forks source link

HAM map saving fails when unsupportedInfoProperties isn't empty #221

Open Arnuh opened 10 months ago

Arnuh commented 10 months ago

Tested on v115 of GMS with map 921160100. It contains a "fieldScript" property which gets put into unsupportedInfoProperties of MapInfo. Can reproduce this issue on any version by adding a fake property in a maps info node.

The JSON serializer is infinite looping/just having issues in general trying to serialize MapleLib objects due to fields like Parent, WzFileParent, parent being a WzFile, WzObject, etc, resulting in having other fields like parent, and children, ending in the serializer essentially trying to save the entire wz as a JSON file.

An option is to note all these fields as [IgnoreDataMember] but I'm not sure how well that'll work when putting the property back as that is the purpose of unsupportedInfoProperties. Looks like parent gets set again so safe? but other parent objects still cause issues. Might have to strip all of this parent data on save using [IgnoreDataMember] then fix it after deserializing.

I assume additionalNonInfoProps and additionalProps will cause the same issue.

Arnuh commented 10 months ago

Noticed this is the same issue as #210