aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-10-20 04:39:10 +0000
committerTorbjörn Andersson2008-10-20 04:39:10 +0000
commit871375d4b518681e7782502c8f2df07bf85b27a5 (patch)
tree910001feac6cb6a83d9aaa5ae27b51b8b984cd12 /engines/sword1
parentf1a0d7dfb215708af1cc7fa6252c45b6ee5eca90 (diff)
downloadscummvm-rg350-871375d4b518681e7782502c8f2df07bf85b27a5.tar.gz
scummvm-rg350-871375d4b518681e7782502c8f2df07bf85b27a5.tar.bz2
scummvm-rg350-871375d4b518681e7782502c8f2df07bf85b27a5.zip
I believe this fixes bug #2162345 ("BS1: Can't overwrite savegame"), but I'd
really appreciate it if someone would test it further, in case I missed something. (Broken Sword 1 stores the names of the savegames in a separate file, and that has to be in sync with the individual savegame files. In my experience, that sort of thing can really attract bugs...) svn-id: r34828
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/control.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index 2e283915fb..c566b6f1e2 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -703,7 +703,7 @@ void Control::handleSaveKey(Common::KeyState kbd) {
bool Control::saveToFile(void) {
if ((_selectedSavegame == 255) || !strlen((char*)_saveNames[_selectedSavegame]))
return false; // no saveslot selected or no name entered
- saveGameToFile(_numSaves);
+ saveGameToFile(_selectedSavegame);
writeSavegameDescriptions();
return true;
}
@@ -737,8 +737,7 @@ void Control::readSavegameDescriptions(void) {
_saveNames[curFileNum][pos++] = ch;
}
} while ((ch != 10) && (ch != 255) && (!inf->eos()));
- if (_saveNames[curFileNum][0] != 0)
- curFileNum++;
+ curFileNum++;
} while ((ch != 255) && (!inf->eos()));
_saveFiles = curFileNum;
_numSaves = _saveFiles;