From 871375d4b518681e7782502c8f2df07bf85b27a5 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 20 Oct 2008 04:39:10 +0000 Subject: 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 --- engines/sword1/control.cpp | 5 ++--- 1 file 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; -- cgit v1.2.3