[Scummvm-git-logs] scummvm master -> 6fca0e1111c99744b584c775e3db253763794f80
AndywinXp
noreply at scummvm.org
Fri Oct 17 20:50:10 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
6fca0e1111 SCUMM: CHASE (HE): Fix savegame handling
Commit: 6fca0e1111c99744b584c775e3db253763794f80
https://github.com/scummvm/scummvm/commit/6fca0e1111c99744b584c775e3db253763794f80
Author: AndywinXp (andywinxp at gmail.com)
Date: 2025-10-17T22:50:02+02:00
Commit Message:
SCUMM: CHASE (HE): Fix savegame handling
We've always been under the assumption that no game
would ever save stuff under the same name as actual
data files. Therefore we've always stripped down the path
before the filename and appended the target onto that.
Assumption broken :)
Spy Fox In: Cheese Chase saves custom levels with the
same name as the actual ones, but on a different path.
This means that attempting to run the normal game would
sometimes load custom levels up until level 15.
Another good catch, and fix written by @eriktorbjorn.
Changed paths:
engines/scumm/he/script_v60he.cpp
engines/scumm/scumm.cpp
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 5d65f0be156..9b6cfaa8059 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -146,7 +146,19 @@ Common::String ScummEngine_v60he::convertSavePath(const byte *src) {
debug(2, "convertSavePath in: '%s'", (const char *)src);
// Strip us down to only the file
- Common::String filePath = convertFilePath(src).baseName();
+ Common::Path path = convertFilePath(src);
+ Common::String filePath = path.baseName();
+
+ // Cheese Chase uses save file names that clash with the built-in
+ // levels, so keep last two components. The first of them seems to tie
+ // the custom level sets to a specific player anyway, so this is a
+ // win-win.
+ if (strcmp(_game.gameid, "chase") == 0 && (filePath.hasSuffixIgnoreCase(".map") || filePath.hasSuffixIgnoreCase(".obj"))) {
+ Common::StringArray components = convertFilePath(src).splitComponents();
+ int size = components.size();
+ if (size >= 2 && components[size - 2].size() == 3)
+ filePath = components[size - 2] + '-' + components[size - 1];
+ }
// Prepend the target name
filePath = _targetName + '-' + filePath;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 1030a7de407..eac13db791e 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2647,6 +2647,23 @@ Common::Error ScummEngine::go() {
}
}
+#ifdef ENABLE_HE
+ // Old "Spy Fox In: Cheese Chase" custom levels clash with the built-in levels.
+ // Assign them to the first player, 000.
+ if (strcmp(_game.gameid, "chase") == 0) {
+ Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+ Common::StringArray filenames;
+ filenames = saveFileMan->listSavefiles(_targetName + "-chase???.???");
+
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+ Common::String from = (*file).c_str();
+ Common::String to = (*file).c_str();
+ to.insertString("000-", from.size() - 12);
+ saveFileMan->renameSavefile(from, to);
+ }
+ }
+#endif // ENABLE_HE
+
while (!shouldQuit()) {
// Determine how long to wait before the next loop iteration should start
int delta = (VAR_TIMER_NEXT != 0xFF) ? VAR(VAR_TIMER_NEXT) : 4;
More information about the Scummvm-git-logs
mailing list