diff options
author | Travis Howell | 2007-06-08 08:40:23 +0000 |
---|---|---|
committer | Travis Howell | 2007-06-08 08:40:23 +0000 |
commit | 95fe36a8284f51855c3210695159965d283fc14c (patch) | |
tree | de0133e30421212f7740a3bef595b4f30ab5cedf /engines/agos | |
parent | b59f4be4d16e93d86c84261268888be16e988ad5 (diff) | |
download | scummvm-rg350-95fe36a8284f51855c3210695159965d283fc14c.tar.gz scummvm-rg350-95fe36a8284f51855c3210695159965d283fc14c.tar.bz2 scummvm-rg350-95fe36a8284f51855c3210695159965d283fc14c.zip |
Don't save game, when no saved game name is given in earlier games.
svn-id: r27195
Diffstat (limited to 'engines/agos')
-rw-r--r-- | engines/agos/saveload.cpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index dc6839c2a6..c90ffc223c 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -283,26 +283,29 @@ restart: } } - int16 slot = matchSaveGame(name, numSaveGames); - if (!load) { - if (slot >= 0 && !confirmOverWrite(window)) - goto restart; + if (_saveGameNameLen != 0) { + int16 slot = matchSaveGame(name, numSaveGames); + if (!load) { + if (slot >= 0 && !confirmOverWrite(window)) + goto restart; - if (slot < 0) - slot = numSaveGames; + if (slot < 0) + slot = numSaveGames; - if (!saveGame(slot, name)) - fileError(_windowArray[4], true); - } else { - if (slot < 0) { - fileError(_windowArray[4], false); + if (!saveGame(slot, name)) + fileError(_windowArray[4], true); } else { - if (!loadGame(genSaveName(slot))) + if (slot < 0) { fileError(_windowArray[4], false); + } else { + if (!loadGame(genSaveName(slot))) + fileError(_windowArray[4], false); + } } + + printStats(); } - printStats(); restartAnimation(); _gameStoppedClock = time(NULL) - saveTime + _gameStoppedClock; } @@ -459,11 +462,13 @@ void AGOSEngine_Elvira2::userGame(bool load) { } } - if (slot < 0) - slot = numSaveGames; + if (_saveGameNameLen != 0) { + if (slot < 0) + slot = numSaveGames; - if (!saveGame(slot, buf + 192)) - fileError(_windowArray[num], true); + if (!saveGame(slot, buf + 192)) + fileError(_windowArray[num], true); + } } else { i = userGameGetKey(&b, buf, 128); if (i != 225) { |