diff --git a/source/mkw/Patch/PatchDirectory.py b/source/mkw/Patch/PatchDirectory.py index 1ce1bba..1717f2f 100644 --- a/source/mkw/Patch/PatchDirectory.py +++ b/source/mkw/Patch/PatchDirectory.py @@ -24,7 +24,7 @@ class PatchDirectory(PatchObject): """ yield {"description": f"Patching {self}"} - if self.patch.safe_eval(self.configuration["if"], {"extracted_game": extracted_game}) == "False": return + if self.patch.safe_eval(self.configuration["if"], env={"extracted_game": extracted_game}) != "True": return match self.configuration["mode"]: # if the mode is copy, then simply patch the subfile into the game with the same path diff --git a/source/mkw/Patch/PatchFile.py b/source/mkw/Patch/PatchFile.py index da85130..e071c40 100644 --- a/source/mkw/Patch/PatchFile.py +++ b/source/mkw/Patch/PatchFile.py @@ -31,7 +31,7 @@ class PatchFile(PatchObject): yield {"description": f"Patching {self}"} # check if the file should be patched considering the "if" configuration - if self.patch.safe_eval(self.configuration["if"], {"extracted_game": extracted_game}) == "False": return + if self.patch.safe_eval(self.configuration["if"], env={"extracted_game": extracted_game}) != "True": return # check if the path to the game_subpath is inside a szs, and if yes extract it for szs_subpath in filter(lambda path: path.suffix == ".d",