aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2017-08-03 22:44:59 -0400
committerGitHub2017-08-03 22:44:59 -0400
commite1754fbec7fec66334a47d6dca7c1e90bd424039 (patch)
tree4d97355fbf50c769dac8956166669378da07b410 /engines/titanic
parent1f4b97ac7c2350dac7f4edf6976d62879a763546 (diff)
parenteb050826174c1996e9d052d554c946420c192bc8 (diff)
downloadscummvm-rg350-e1754fbec7fec66334a47d6dca7c1e90bd424039.tar.gz
scummvm-rg350-e1754fbec7fec66334a47d6dca7c1e90bd424039.tar.bz2
scummvm-rg350-e1754fbec7fec66334a47d6dca7c1e90bd424039.zip
Merge pull request #980 from dafioram/titanic_access_last_save
TITANIC: Fix access to last savegame slot
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/core/project_item.cpp3
-rw-r--r--engines/titanic/detection.cpp4
-rw-r--r--engines/titanic/main_game_window.cpp2
3 files changed, 3 insertions, 6 deletions
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index a3ac284af8..b16d076f14 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -35,7 +35,6 @@
namespace Titanic {
#define CURRENT_SAVEGAME_VERSION 1
-#define MAX_SAVEGAME_SLOTS 99
#define MINIMUM_SAVEGAME_VERSION 1
static const char *const SAVEGAME_STR = "TNIC";
@@ -464,7 +463,7 @@ SaveStateList CProjectItem::getSavegameList(const Common::String &target) {
const char *ext = strrchr(file->c_str(), '.');
int slot = ext ? atoi(ext + 1) : -1;
- if (slot >= 0 && slot < MAX_SAVEGAME_SLOTS) {
+ if (slot >= 0 && slot <= MAX_SAVES) {
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
if (in) {
diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
index 8c990e2525..098c20ca1d 100644
--- a/engines/titanic/detection.cpp
+++ b/engines/titanic/detection.cpp
@@ -33,8 +33,6 @@
#include "graphics/colormasks.h"
#include "graphics/surface.h"
-#define MAX_SAVES 99
-
namespace Titanic {
struct TitanicGameDescription {
@@ -120,7 +118,7 @@ SaveStateList TitanicMetaEngine::listSaves(const char *target) const {
const char *ext = strrchr(file->c_str(), '.');
int slot = ext ? atoi(ext + 1) : -1;
- if (slot >= 0 && slot < MAX_SAVES) {
+ if (slot >= 0 && slot <= MAX_SAVES) {
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
if (in) {
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index b578bb942e..559e186f70 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -117,7 +117,7 @@ int CMainGameWindow::selectSavegame() {
bool hasSavegames = false;
// Loop through save slots to find any existing save slots
- for (int idx = 0; idx < MAX_SAVES; ++idx) {
+ for (int idx = 0; idx <= MAX_SAVES; ++idx) {
CString saveName = g_vm->getSavegameName(idx);
if (!saveName.empty()) {
dialog.addSavegame(idx, saveName);