From 9ec7c3eaca458fd1647c51deab0632f5427d5f2d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 14 Sep 2008 14:08:14 +0000 Subject: Added a hack in KyraMetaEngine::listSaves to prevent slot 0 from being listed. Check comment for additional information. svn-id: r34521 --- engines/kyra/detection.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/kyra/detection.cpp') diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index f2c929c6fb..834f9f70c6 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -1135,7 +1135,10 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const { // Obtain the last 3 digits of the filename, since they correspond to the save slot int slotNum = atoi(file->c_str() + file->size() - 3); - if (slotNum >= 0 && slotNum <= 999) { + // HACK: Until we have a way to check whether a save is deletable in our launcher delete savegame dialog. + // We do not list slot 0 here, since it's for restarting the game and it should never be deleted. + // The downside of it is of course we can not load it via the menu and it isn't listed via --list-saves. + if (slotNum > 0 && slotNum <= 999) { Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); if (in) { if (Kyra::KyraEngine_v1::readSaveHeader(in, false, header) == Kyra::KyraEngine_v1::kRSHENoError) { @@ -1154,7 +1157,7 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const { } void KyraMetaEngine::removeSaveState(const char *target, int slot) const { - // Slot 0 can't be delted, it's for restarting the game(s) + // Slot 0 can't be deleted, it's for restarting the game(s) if (slot == 0) return; -- cgit v1.2.3