From 26142799adf6ef4e07a3a91c413f40c7253aa3f8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 19 Sep 2016 10:13:47 +0200 Subject: FULLPIPE: Correct slot number on loading --- engines/fullpipe/modal.cpp | 2 +- engines/fullpipe/stateloader.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 5f8afbc761..cceec4a852 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -1622,7 +1622,7 @@ char *ModalSaveGame::getSaveName() { if (_queryRes < 0) return 0; - return _files[_queryRes]->filename; + return _files[_queryRes - 1]->filename; } bool ModalSaveGame::getFileInfo(int slot, FileInfo *fileinfo) { diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 3d74e93566..588a366df7 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -42,6 +42,11 @@ void GameLoader::readSavegame(const char *fname) { SaveHeader header; Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(fname); + if (!saveFile) { + warning("Cannot open save %s for loading", fname); + return; + } + header.version = saveFile->readUint32LE(); saveFile->read(header.magic, 32); header.updateCounter = saveFile->readUint32LE(); -- cgit v1.2.3