summaryrefslogtreecommitdiffstats
path: root/src/save
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-08-08 16:14:21 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-08-08 16:14:21 +0200
commit478bdcc1ca041bccf791c3aa7dbbc1a04da72454 (patch)
tree589cfc6708f54f58e10d5c8774fcb244c79b46e3 /src/save
parentMerge branch 'master' into miami (diff)
parentsmall refactoring (diff)
downloadre3-478bdcc1ca041bccf791c3aa7dbbc1a04da72454.tar
re3-478bdcc1ca041bccf791c3aa7dbbc1a04da72454.tar.gz
re3-478bdcc1ca041bccf791c3aa7dbbc1a04da72454.tar.bz2
re3-478bdcc1ca041bccf791c3aa7dbbc1a04da72454.tar.lz
re3-478bdcc1ca041bccf791c3aa7dbbc1a04da72454.tar.xz
re3-478bdcc1ca041bccf791c3aa7dbbc1a04da72454.tar.zst
re3-478bdcc1ca041bccf791c3aa7dbbc1a04da72454.zip
Diffstat (limited to 'src/save')
-rw-r--r--src/save/GenericGameStorage.cpp6
-rw-r--r--src/save/GenericGameStorage.h10
2 files changed, 13 insertions, 3 deletions
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index c42ae738..c696726b 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -1176,16 +1176,16 @@ void DisplaySaveResult(int unk, char* name)
bool SaveGameForPause(int type)
{
- if (AllowMissionReplay != 0 && AllowMissionReplay != 7) {
+ if (AllowMissionReplay != MISSION_RETRY_STAGE_NORMAL && AllowMissionReplay != MISSION_RETRY_STAGE_WAIT_FOR_TIMER_AFTER_RESTART) {
debug("SaveGameForPause failed during AllowMissionReplay %d", AllowMissionReplay);
return false;
}
- if (type != 3 && WaitForSave > CTimer::GetTimeInMilliseconds()) {
+ if (type != SAVE_TYPE_QUICKSAVE_FOR_MISSION_REPLAY && WaitForSave > CTimer::GetTimeInMilliseconds()) {
debug("SaveGameForPause failed WaitForSave");
return false;
}
WaitForSave = 0;
- if (gGameState != GS_PLAYING_GAME || (CTheScripts::bAlreadyRunningAMissionScript && type != 5)) {
+ if (gGameState != GS_PLAYING_GAME || (CTheScripts::bAlreadyRunningAMissionScript && type != SAVE_TYPE_QUICKSAVE_FOR_SCRIPT_ON_A_MISSION)) {
DisplaySaveResult(3, CStats::LastMissionPassedName);
return false;
}
diff --git a/src/save/GenericGameStorage.h b/src/save/GenericGameStorage.h
index b2bf7a24..bebf426a 100644
--- a/src/save/GenericGameStorage.h
+++ b/src/save/GenericGameStorage.h
@@ -53,4 +53,14 @@ 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,
+ SAVE_TYPE_QUICKSAVE_FOR_SCRIPT,
+ SAVE_TYPE_QUICKSAVE_FOR_SCRIPT_ON_A_MISSION
+};
+
#endif