aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-08-05 13:08:07 +0000
committerMax Horn2008-08-05 13:08:07 +0000
commitbedebaccc39bdef75fe316ea20e57c6dec5b501e (patch)
treef812be6eeb82346b3bc49b54dd1ae76725101a7e
parent966b5eb94eec33f52536e2e4cf9cf3b359fcbaf8 (diff)
downloadscummvm-rg350-bedebaccc39bdef75fe316ea20e57c6dec5b501e.tar.gz
scummvm-rg350-bedebaccc39bdef75fe316ea20e57c6dec5b501e.tar.bz2
scummvm-rg350-bedebaccc39bdef75fe316ea20e57c6dec5b501e.zip
SCUMM: Don't try to load metadata for slot -1 (i.e. don't try to load metadata if nothing is selected)
svn-id: r33639
-rw-r--r--engines/scumm/dialogs.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index e4e2b2b620..e6cbdb12a8 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -364,8 +364,9 @@ void SaveLoadChooser::reflowLayout() {
void SaveLoadChooser::updateInfos(bool redraw) {
int selItem = _list->getSelected();
- Graphics::Surface *thumb;
- thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem);
+ Graphics::Surface *thumb = 0;
+ if (selItem >= 0)
+ thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem);
if (thumb) {
_gfxWidget->setGfx(thumb);
@@ -382,7 +383,7 @@ void SaveLoadChooser::updateInfos(bool redraw) {
InfoStuff infos;
memset(&infos, 0, sizeof(InfoStuff));
char buffer[32];
- if (_vm->loadInfosFromSlot(_saveMode ? selItem + 1 : selItem, &infos)) {
+ if (selItem >= 0 && _vm->loadInfosFromSlot(_saveMode ? selItem + 1 : selItem, &infos)) {
snprintf(buffer, 32, "Date: %.2d.%.2d.%.4d",
(infos.date >> 24) & 0xFF, (infos.date >> 16) & 0xFF,
infos.date & 0xFFFF);