aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2007-09-22 22:37:20 +0000
committerFilippos Karapetis2007-09-22 22:37:20 +0000
commit4333fafe76ecbb1a53bcfeba108b6d9e3d626b9f (patch)
tree80d7d9f6a9ed02d51dbe713292b34fa5d779c2e6 /engines
parentb93e906285c1bba1ee70aebe23cd225b28cfeeb5 (diff)
downloadscummvm-rg350-4333fafe76ecbb1a53bcfeba108b6d9e3d626b9f.tar.gz
scummvm-rg350-4333fafe76ecbb1a53bcfeba108b6d9e3d626b9f.tar.bz2
scummvm-rg350-4333fafe76ecbb1a53bcfeba108b6d9e3d626b9f.zip
Fix for bug #1800276 - "IHNM: Problem in saving". A bug in the logic of the save slot allocation algorithm became apparent with the FS node merge. It should be working correctly now
svn-id: r29031
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/saga.h3
-rw-r--r--engines/saga/saveload.cpp8
2 files changed, 3 insertions, 8 deletions
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 8016fb9e65..eece1ee039 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -517,7 +517,7 @@ public:
uint getNewSaveSlotNumber();
bool locateSaveFile(char *saveName, uint &titleNumber);
bool isSaveListFull() const {
- return _saveFilesMaxCount == _saveFilesCount;
+ return _saveFilesCount == MAX_SAVES;
}
uint getSaveFilesCount() const {
return isSaveListFull() ? _saveFilesCount : _saveFilesCount + 1;
@@ -611,7 +611,6 @@ public:
}
private:
- uint _saveFilesMaxCount;
uint _saveFilesCount;
SaveFileData _saveFiles[MAX_SAVES];
bool _saveMarks[MAX_SAVES];
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index b73a6fae28..e37479e80e 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -59,7 +59,7 @@ char* SagaEngine::calcSaveFileName(uint slotNumber) {
}
SaveFileData *SagaEngine::getSaveFile(uint idx) {
- if (idx >= _saveFilesMaxCount) {
+ if (idx >= MAX_SAVES) {
error("getSaveFileName wrong idx");
}
if (isSaveListFull()) {
@@ -94,7 +94,7 @@ uint SagaEngine::getNewSaveSlotNumber() {
error("getNewSaveSlotNumber save list is full");
}
for (i = 0; i < MAX_SAVES; i++) {
- if (_saveMarks[i]) {
+ if (!_saveMarks[i]) {
found = false;
for (j = 0; j < _saveFilesCount; j++) {
if (_saveFiles[j].slotNumber == i) {
@@ -138,11 +138,7 @@ void SagaEngine::fillSaveList() {
_saveMarks[slotNum] = true; //mark this slot as valid
}
- _saveFilesMaxCount = 0;
for (i = 0; i < MAX_SAVES; i++) {
- if (_saveMarks[i]) {
- _saveFilesMaxCount++;
- }
_saveFiles[i].name[0] = 0;
_saveFiles[i].slotNumber = (uint)-1;
}