diff --git a/UnityPy/environment.py b/UnityPy/environment.py index bfbeca6f..3dfec029 100644 --- a/UnityPy/environment.py +++ b/UnityPy/environment.py @@ -64,12 +64,12 @@ def load_files(self, files: list): for basepath in splits: # merge data data = io.BytesIO() - for i in range(1, 999): + for i in range(0, 999): item = f"{basepath}.split{i}" if os.path.exists(item): with open(item, "rb") as f: data.write(f.read()) - else: + elif i: break self.files[self.reduce_path(basepath)] = self.load_file(data) @@ -159,12 +159,12 @@ def load_zip_file(self, value): for basepath in splits: # merge data data = io.BytesIO() - for i in range(1, 999): + for i in range(0, 999): item = f"{basepath}.split{i}" if item in z.namelist(): with z.open(item) as f: data.write(f.read()) - else: + elif i: break *path, name = basepath.split("/") cur = self