fix: add-section paths were not correctly added to the list of cheat code to patch

This commit is contained in:
Faraphel 2023-01-31 20:04:47 +01:00
parent b3e2fb7142
commit 925dc205b7
2 changed files with 4 additions and 2 deletions

View file

@ -33,7 +33,7 @@ class StrEditor(AbstractPatchOperation):
if not section_path.is_relative_to(patch.path):
raise PathOutsideAllowedRange(section_path, patch.path)
checked_sections += section_path
checked_sections.append(section_path)
# for every file in the sections, check if they are inside the patch.
patch_content = BytesIO(

View file

@ -25,7 +25,9 @@ def patch_data(dol_data: bytes, region: int = None, https: str = None, domain: s
for section in sections if sections is not None else []:
args.extend(["--add-section", section])
process = _tools_run_popen("PATCH", "-", "--DEST", "-", *args)
# force is used for cheatcode to overlap code
process = _tools_run_popen("PATCH", "--force", "-", "--DEST", "-", *args)
stdout, _ = process.communicate(input=dol_data)
if process.returncode != 0:
raise WTError(tools_path, process.returncode)