BrawlCrate for a long time had issues with the U8 tree when saving any changes, or no changes at all in some cases. This was caused by two seperate bugs that influenced the value of the dataLength value in directory nodes:
An off-by-one error when opening the archive combined with a ChildEndIndex check on a child node instead of the parent directory caused directories to be wrongfully put under a subdirectory of a sibling directory, something that would not be visible in the tree view because the tree view uses the parent idx field from the imported file instead.
The last subdirectory in any directory would automatically put every single other node that followed in the tree under itself, as it unintendedly used a fallback value (the end of the tree).
Both points are addressed in this PR and U8 archives are now properly saved in the correct format.
BrawlCrate for a long time had issues with the U8 tree when saving any changes, or no changes at all in some cases. This was caused by two seperate bugs that influenced the value of the
dataLength
value in directory nodes:ChildEndIndex
check on a child node instead of the parent directory caused directories to be wrongfully put under a subdirectory of a sibling directory, something that would not be visible in the tree view because the tree view uses the parent idx field from the imported file instead.Both points are addressed in this PR and U8 archives are now properly saved in the correct format.