Handle SCUMMVM_SAVEPATH exactly like the command line option --savepath (but the command line option has higher priority); i.e. it's affecting the config system (see also bug #1045171)

svn-id: r16391
This commit is contained in:
Max Horn 2004-12-30 21:48:22 +00:00
parent 75f31d28c9
commit acd1f910d5
2 changed files with 21 additions and 16 deletions

View file

@ -39,21 +39,15 @@ const char *SaveFileManager::getSavePath() const {
const char *dir = NULL;
#if !defined(MACOS_CARBON) && !defined(_WIN32_WCE)
dir = getenv("SCUMMVM_SAVEPATH");
#endif
// If SCUMMVM_SAVEPATH was not specified, try to use game specific savepath from config
if (!dir || dir[0] == 0) {
// Try to use game specific savepath from config
dir = ConfMan.get("savepath").c_str();
// Work around a bug (#999122) in the original 0.6.1 release of
// ScummVM, which would insert a bad savepath value into config files.
if (0 == strcmp(dir, "None")) {
ConfMan.removeKey("savepath", ConfMan.getActiveDomain());
ConfMan.flushToDisk();
dir = ConfMan.get("savepath").c_str();
// Work around a bug (#999122) in the original 0.6.1 release of
// ScummVM, which would insert a bad savepath value into config files.
if (0 == strcmp(dir, "None")) {
ConfMan.removeKey("savepath", ConfMan.getActiveDomain());
ConfMan.flushToDisk();
dir = ConfMan.get("savepath").c_str();
}
}
#ifdef _WIN32_WCE