aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2011-10-01 17:03:29 +0200
committerJohannes Schickel2011-10-01 17:03:29 +0200
commit74f3a29c1913bfac1cd0f4c6edabf2fb58334c1c (patch)
tree9da423db704a8de473e34075d29f82c00c76ab81 /engines
parent5ea975ad0cea675cd07d47e0e1df35230ea5e1e9 (diff)
downloadscummvm-rg350-74f3a29c1913bfac1cd0f4c6edabf2fb58334c1c.tar.gz
scummvm-rg350-74f3a29c1913bfac1cd0f4c6edabf2fb58334c1c.tar.bz2
scummvm-rg350-74f3a29c1913bfac1cd0f4c6edabf2fb58334c1c.zip
KYRA: Never allow slots 0 and 990-999 to be overwritten.
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/detection.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 0a49483f12..68eb08210e 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -187,6 +187,7 @@ void KyraMetaEngine::removeSaveState(const char *target, int slot) const {
SaveStateDescriptor KyraMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
Common::String filename = Kyra::KyraEngine_v1::getSavegameFilename(target, slot);
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename);
+ const bool lolGame = ConfMan.getDomain(target)->getVal("gameid").equalsIgnoreCase("lol");
if (in) {
Kyra::KyraEngine_v1::SaveHeader header;
@@ -198,14 +199,13 @@ SaveStateDescriptor KyraMetaEngine::querySaveMetaInfos(const char *target, int s
if (error == Kyra::KyraEngine_v1::kRSHENoError) {
SaveStateDescriptor desc(slot, header.description);
- bool lolGame = ConfMan.getDomain(target)->getVal("gameid").equalsIgnoreCase("lol");
-
// Slot 0 is used for the 'restart game' save in all three Kyrandia games, thus
// we prevent it from being deleted.
desc.setDeletableFlag(slot != 0 || lolGame);
// We don't allow quick saves (slot 990 till 998) to be overwritten.
- // The same goes for the 'Autosave', which is slot 999.
+ // The same goes for the 'Autosave', which is slot 999. Slot 0 will also
+ // be protected in Kyra 1-3, since it's the 'restart game' save.
desc.setWriteProtectedFlag((slot == 0 && !lolGame) || slot >= 990);
desc.setThumbnail(header.thumbnail);
@@ -213,7 +213,14 @@ SaveStateDescriptor KyraMetaEngine::querySaveMetaInfos(const char *target, int s
}
}
- return SaveStateDescriptor();
+ SaveStateDescriptor desc(slot, Common::String());
+
+ // We don't allow quick saves (slot 990 till 998) to be overwritten.
+ // The same goes for the 'Autosave', which is slot 999. Slot 0 will also
+ // be protected in Kyra 1-3, since it's the 'restart game' save.
+ desc.setWriteProtectedFlag((slot == 0 && !lolGame) || slot >= 990);
+
+ return desc;
}
#if PLUGIN_ENABLED_DYNAMIC(KYRA)