summaryrefslogtreecommitdiffstats
path: root/src/save
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-08-14 21:41:04 +0200
committereray orçunus <erayorcunus@gmail.com>2020-08-14 21:44:12 +0200
commit8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa (patch)
tree49641e7b24ac8366e8569ecf43a95e13e9490b2f /src/save
parentWheelie opcode (diff)
downloadre3-8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa.tar
re3-8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa.tar.gz
re3-8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa.tar.bz2
re3-8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa.tar.lz
re3-8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa.tar.xz
re3-8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa.tar.zst
re3-8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa.zip
Diffstat (limited to '')
-rw-r--r--src/save/GenericGameStorage.cpp2
-rw-r--r--src/save/GenericGameStorage.h2
-rw-r--r--src/save/PCSave.cpp8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index 61a32a8d..4f69123b 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -57,7 +57,7 @@ wchar SlotSaveDate[SLOT_COUNT][70];
int CheckSum;
eLevelName m_LevelToLoad;
char SaveFileNameJustSaved[260];
-int Slots[SLOT_COUNT+1];
+int Slots[SLOT_COUNT];
CDate CompileDateAndTime;
bool b_FoundRecentSavedGameWantToLoad;
diff --git a/src/save/GenericGameStorage.h b/src/save/GenericGameStorage.h
index 069ba7cd..630b3b50 100644
--- a/src/save/GenericGameStorage.h
+++ b/src/save/GenericGameStorage.h
@@ -31,7 +31,7 @@ extern wchar SlotFileName[SLOT_COUNT][260];
extern wchar SlotSaveDate[SLOT_COUNT][70];
extern int CheckSum;
extern enum eLevelName m_LevelToLoad;
-extern int Slots[SLOT_COUNT+1];
+extern int Slots[SLOT_COUNT];
extern bool b_FoundRecentSavedGameWantToLoad;
extern bool JustLoadedDontFadeInYet;
diff --git a/src/save/PCSave.cpp b/src/save/PCSave.cpp
index da8134fc..8514a2b6 100644
--- a/src/save/PCSave.cpp
+++ b/src/save/PCSave.cpp
@@ -88,7 +88,7 @@ void
C_PcSave::PopulateSlotInfo()
{
for (int i = 0; i < SLOT_COUNT; i++) {
- Slots[i + 1] = SLOT_EMPTY;
+ Slots[i] = SLOT_EMPTY;
SlotFileName[i][0] = '\0';
SlotSaveDate[i][0] = '\0';
}
@@ -108,14 +108,14 @@ C_PcSave::PopulateSlotInfo()
if (file != 0) {
CFileMgr::Read(file, (char*)&header, sizeof(header));
if (strncmp((char*)&header, TopLineEmptyFile, sizeof(TopLineEmptyFile)-1) != 0) {
- Slots[i + 1] = SLOT_OK;
+ Slots[i] = SLOT_OK;
memcpy(SlotFileName[i], &header.FileName, sizeof(header.FileName));
SlotFileName[i][24] = '\0';
}
CFileMgr::CloseFile(file);
}
- if (Slots[i + 1] == SLOT_OK) {
+ if (Slots[i] == SLOT_OK) {
if (CheckDataNotCorrupt(i, savename)) {
SYSTEMTIME st;
memcpy(&st, &header.SaveDateTime, sizeof(SYSTEMTIME));
@@ -147,7 +147,7 @@ C_PcSave::PopulateSlotInfo()
} else {
CMessages::InsertNumberInString(TheText.Get("FEC_SLC"), i + 1, -1, -1, -1, -1, -1, SlotFileName[i]);
- Slots[i + 1] = SLOT_CORRUPTED;
+ Slots[i] = SLOT_CORRUPTED;
}
}
}