From 879558a3a759b26c4682d0da6637c5544c1b1413 Mon Sep 17 00:00:00 2001
From: fxceless <36782933+fxceless@users.noreply.github.com>
Date: Fri, 27 Nov 2026 23:09:51 +0300
Subject: [PATCH] HLE: a save version that cannot be removed does not fail the
container
`current` removed unfinished and older save versions and propagated any
error. A file another program holds without letting it be deleted (a virus
scanner, a backup in progress) then failed the whole lookup: the container
read as unreadable and every save of it failed for as long as the file was
held, though the newest readable version was intact.
Both removals are now best-effort and logged; the leftovers go at a later
save, when the file is free.
Ported from fxceless/victory-fork 6a42ed27, GPL-3.0-or-later.
(cherry picked from commit 0438a1b7467cfa33bfe59336cb99326ae9c4561a)
---
crates/victory-hle/src/modules/xgamesave.rs | 63 ++++++++++++++++++++-
1 file changed, 61 insertions(+), 2 deletions(-)
diff --git a/crates/victory-hle/src/modules/xgamesave.rs b/crates/victory-hle/src/modules/xgamesave.rs
index 29db201..6141c5d 100644
--- a/crates/victory-hle/src/modules/xgamesave.rs
+++ b/crates/victory-hle/src/modules/xgamesave.rs
@@ -213,7 +213,12 @@ fn current(dir: &Path) -> std::io::Result