From 04268a17a13452866a6d63655a780fa25d0cb130 Mon Sep 17 00:00:00 2001 From: Faraphel Date: Fri, 15 Jul 2022 20:25:04 +0200 Subject: [PATCH] added seek(0) before writing a PatchFile --- source/mkw/Patch/PatchFile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/mkw/Patch/PatchFile.py b/source/mkw/Patch/PatchFile.py index 3a1e6f6..aa035d7 100644 --- a/source/mkw/Patch/PatchFile.py +++ b/source/mkw/Patch/PatchFile.py @@ -65,6 +65,7 @@ class PatchFile(PatchObject): game_subpath.parent.mkdir(parents=True, exist_ok=True) with open(game_subpath.parent / patch_name, "wb") as file: + patch_content.seek(0) file.write(patch_content.read()) # if the mode is match, replace all the subfiles that match match_regex by the PatchFile @@ -78,6 +79,7 @@ class PatchFile(PatchObject): game_subfile.parent.mkdir(parents=True, exist_ok=True) with open(game_subfile, "wb") as file: + patch_content.seek(0) file.write(patch_content.read()) # ignore if mode is "ignore", useful if the file is used as a resource for an operation