Skip to content

Commit 2e8a79c

Browse files
sw1tchbl4d3rK0lb3
authored andcommitted
fix(SerializedFile): order written objects by path_id
1 parent 14f2134 commit 2e8a79c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

UnityPy/files/SerializedFile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def save(self, packer: Optional[str] = None) -> bytes:
413413

414414
# ReadObjects
415415
meta_writer.write_int(len(self.objects))
416-
for obj in self.objects.values():
416+
for obj in sorted(self.objects.values(), key=lambda x: x.path_id):
417417
obj.write(header, meta_writer, data_writer)
418418
data_writer.align_stream(8)
419419

0 commit comments

Comments
 (0)