summaryrefslogtreecommitdiffstats
path: root/src/save
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/save/GenericGameStorage.cpp5
-rw-r--r--src/save/GenericGameStorage.h8
2 files changed, 12 insertions, 1 deletions
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index f51f8233..e4ee4542 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -1030,6 +1030,7 @@ FixSave(int32 slot, uint8 save_type)
totalSize = 0;
CFileMgr::Read(file_in, (const char *)&size, sizeof(size));
+ size = align4bytes(size);
buf = work_buff;
CFileMgr::Read(file_in, (const char *)work_buff, size); // simple vars + scripts
@@ -1153,7 +1154,9 @@ void DisplaySaveResult(int unk, char* name)
bool SaveGameForPause(int type)
{
- if (AllowMissionReplay != 0 || type != 3 && WaitForSave > CTimer::GetTimeInMilliseconds())
+ if (AllowMissionReplay != MISSION_RETRY_STAGE_NORMAL)
+ return false;
+ if (type != SAVE_TYPE_QUICKSAVE_FOR_MISSION_REPLAY && WaitForSave > CTimer::GetTimeInMilliseconds())
return false;
WaitForSave = 0;
if (gGameState != GS_PLAYING_GAME || CTheScripts::IsPlayerOnAMission() || CStats::LastMissionPassedName[0] == '\0') {
diff --git a/src/save/GenericGameStorage.h b/src/save/GenericGameStorage.h
index b291ddf9..6a5b04fa 100644
--- a/src/save/GenericGameStorage.h
+++ b/src/save/GenericGameStorage.h
@@ -52,4 +52,12 @@ const char TopLineEmptyFile[] = "THIS FILE IS NOT VALID YET";
extern int8 IsQuickSave; // originally int
bool SaveGameForPause(int);
+
+enum {
+ SAVE_TYPE_NORMAL,
+ SAVE_TYPE_QUICKSAVE,
+ SAVE_TYPE_2,
+ SAVE_TYPE_QUICKSAVE_FOR_MISSION_REPLAY
+};
+
#endif