[Scummvm-cvs-logs] scummvm master -> 74f3a29c1913bfac1cd0f4c6edabf2fb58334c1c
lordhoto
lordhoto at gmail.com
Sat Oct 1 17:10:28 CEST 2011
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:
74f3a29c19 KYRA: Never allow slots 0 and 990-999 to be overwritten.
Commit: 74f3a29c1913bfac1cd0f4c6edabf2fb58334c1c
https://github.com/scummvm/scummvm/commit/74f3a29c1913bfac1cd0f4c6edabf2fb58334c1c
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-10-01T08:03:29-07:00
Commit Message:
KYRA: Never allow slots 0 and 990-999 to be overwritten.
Changed paths:
engines/kyra/detection.cpp
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 0a49483..68eb082 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)
More information about the Scummvm-git-logs
mailing list