[Scummvm-git-logs] scummvm master -> 047f4a060b3b3882aa05c96584568692e202a0aa

criezy criezy at scummvm.org
Mon Aug 30 20:17:52 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
047f4a060b AGS: Flatten paths in the save directory


Commit: 047f4a060b3b3882aa05c96584568692e202a0aa
    https://github.com/scummvm/scummvm/commit/047f4a060b3b3882aa05c96584568692e202a0aa
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-30T21:15:53+01:00

Commit Message:
AGS: Flatten paths in the save directory

ScummVM does not support using sub-directories in the save directory,
so we flatten the path by replacing '/' with '-'.

This fixes saving and loading with the in-game dialogs in Strangeland.
Fixes bug #12864.

Changed paths:
    engines/ags/engine/ac/file.cpp


diff --git a/engines/ags/engine/ac/file.cpp b/engines/ags/engine/ac/file.cpp
index 105a2c3ca4..6b285ea3e4 100644
--- a/engines/ags/engine/ac/file.cpp
+++ b/engines/ags/engine/ac/file.cpp
@@ -351,8 +351,10 @@ bool ResolveScriptPath(const String &orig_sc_path, bool read_only, ResolvedPath
 #if AGS_PLATFORM_SCUMMVM
 	// For files on savepath, always ensure it starts with the game target prefix to avoid
 	// conflicts (as we usually have the same save dir for all games).
+	// Also flatten the path if needed as we do not support subdirectories in the save folder.
 	if (parent_dir.BaseDir == SAVE_FOLDER_PREFIX) {
-		debugC(::AGS::kDebugFilePath, "Adding ScummVM game target prefix");
+		debugC(::AGS::kDebugFilePath, "Adding ScummVM game target prefix and flatten path");
+		child_path.Replace('/', '-');
 		String gameTarget = ConfMan.getActiveDomainName();
 		if (child_path.CompareLeft(gameTarget) != 0)
 			child_path = String::FromFormat("%s-%s", gameTarget.GetCStr(), child_path.GetCStr());




More information about the Scummvm-git-logs mailing list