aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/gui_lol.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2011-11-14 15:39:59 +0100
committerJohannes Schickel2011-11-14 15:42:20 +0100
commitf410480cfd848636cce21d3f89c8a8b0ef068680 (patch)
tree25886667f7c468d1ce2eeaae129f54879177d3e7 /engines/kyra/gui_lol.cpp
parent27bc4f3f08680eff0423c74af8e98fd5b393bf17 (diff)
downloadscummvm-rg350-f410480cfd848636cce21d3f89c8a8b0ef068680.tar.gz
scummvm-rg350-f410480cfd848636cce21d3f89c8a8b0ef068680.tar.bz2
scummvm-rg350-f410480cfd848636cce21d3f89c8a8b0ef068680.zip
KYRA: Fix bug #3437647 "LOL: Unexpected missing save file".
Formerly the code was confused about what _saveSlots is doing, i.e. creating a continous list of existing save slot ids.
Diffstat (limited to 'engines/kyra/gui_lol.cpp')
-rw-r--r--engines/kyra/gui_lol.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp
index 93a1138f1d..22a1561ea8 100644
--- a/engines/kyra/gui_lol.cpp
+++ b/engines/kyra/gui_lol.cpp
@@ -2575,8 +2575,8 @@ void GUI_LoL::setupSaveMenuSlots(Menu &menu, int num) {
int saveSlotMaxLen = ((_screen->getScreenDim(8))->w << 3) - _screen->getCharWidth('W');
for (int i = startSlot; i < num && _savegameOffset + i - slotOffs < _savegameListSize; ++i) {
- if (_savegameList[_saveSlots[i + _savegameOffset - slotOffs]]) {
- Common::strlcpy(s, _savegameList[_saveSlots[i + _savegameOffset - slotOffs]], 80);
+ if (_savegameList[i + _savegameOffset - slotOffs]) {
+ Common::strlcpy(s, _savegameList[i + _savegameOffset - slotOffs], 80);
// Trim long GMM save descriptions to fit our save slots
int fC = _screen->getTextWidth(s);
@@ -2626,7 +2626,7 @@ void GUI_LoL::updateSavegameList() {
_savegameList = new char *[_savegameListSize];
for (int i = 0; i < _savegameListSize; i++) {
- in = _vm->openSaveForReading(_vm->getSavegameFilename(i), header);
+ in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i]), header);
if (in) {
_savegameList[i] = new char[header.description.size() + 1];
Common::strlcpy(_savegameList[i], header.description.c_str(), header.description.size() + 1);
@@ -2634,10 +2634,9 @@ void GUI_LoL::updateSavegameList() {
delete in;
} else {
_savegameList[i] = 0;
- error("GUI_LoL::updateSavegameList(): Unexpected missing save file for slot: %d.", i);
+ error("GUI_LoL::updateSavegameList(): Unexpected missing save file for slot: %d.", _saveSlots[i]);
}
}
-
} else {
_savegameList = 0;
}