aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra/detection.cpp')
-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)