From c62ec754b2a4e0948fde8447cfa55837c6195016 Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Tue, 7 Nov 2023 14:27:15 -0600 Subject: [PATCH] Fix OverrideType rename semantics --- pykotor/tslpatcher/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pykotor/tslpatcher/config.py b/pykotor/tslpatcher/config.py index 4b54c52e8..e061d6e49 100644 --- a/pykotor/tslpatcher/config.py +++ b/pykotor/tslpatcher/config.py @@ -267,7 +267,7 @@ def handle_override_type(self, patch: PatcherModifications): new_filepath: CaseAwarePath = override_dir / ("old_" + patch.saveas) i = 2 while new_filepath.exists(): # tslpatcher does not do this loop. - stem = new_filepath.stem if i == 2 else (new_filepath.stem[4:] + f" ({i})") # noqa: PLR2004 + stem = new_filepath.stem if i == 2 else (new_filepath.stem[:-4] + f" ({i})") # noqa: PLR2004 new_filepath = (new_filepath.parent / stem).with_suffix(new_filepath.suffix) i += 1 try: