aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
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;
}