fixed safe_eval for PatchFile. Now condition need to be exactly True instead of everything but False

This commit is contained in:
Faraphel 2022-07-24 17:38:55 +02:00
parent 7866f5ca36
commit 62a2e31ce2
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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",