aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorFilippos Karapetis2015-01-23 03:01:29 +0200
committerFilippos Karapetis2015-01-23 03:01:29 +0200
commitf7e0d1e958f3b6a4bfff9ba2c9ade03375e8f9d9 (patch)
tree689c4ec1c7dae32775d31c1c725eb53aa2d1d888 /engines/zvision
parente66883d5cbae4d92264cd1c2b5784af79d30f152 (diff)
downloadscummvm-rg350-f7e0d1e958f3b6a4bfff9ba2c9ade03375e8f9d9.tar.gz
scummvm-rg350-f7e0d1e958f3b6a4bfff9ba2c9ade03375e8f9d9.tar.bz2
scummvm-rg350-f7e0d1e958f3b6a4bfff9ba2c9ade03375e8f9d9.zip
ZVISION: Fix shadowed variable
A bug in commit 21e9007d80. Thanks to fingolfin for pointing it out
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/file/save_manager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/zvision/file/save_manager.cpp b/engines/zvision/file/save_manager.cpp
index 55be8d2530..1e0c57e2b3 100644
--- a/engines/zvision/file/save_manager.cpp
+++ b/engines/zvision/file/save_manager.cpp
@@ -136,13 +136,15 @@ Common::Error SaveManager::loadGame(int slot) {
if (slot >= 0) {
saveFile = getSlotFile(slot);
} else {
- Common::File *saveFile = _engine->getSearchManager()->openFile("r.svr");
+ saveFile = _engine->getSearchManager()->openFile("r.svr");
if (!saveFile) {
- saveFile = new Common::File;
- if (!saveFile->open("r.svr")) {
- delete saveFile;
+ Common::File *restoreFile = new Common::File();
+ if (!restoreFile->open("r.svr")) {
+ delete restoreFile;
return Common::kPathDoesNotExist;
}
+
+ saveFile = restoreFile;
}
}