mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
Merge pull request #980 from dafioram/titanic_access_last_save
TITANIC: Fix access to last savegame slot
This commit is contained in:
commit
e1754fbec7
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user