diff options
-rw-r--r-- | engines/sci/engine/kfile.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 9de6cf840d..2ef2d76a62 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -42,6 +42,7 @@ #include "sci/console.h" #ifdef ENABLE_SCI32 #include "sci/engine/guest_additions.h" +#include "sci/engine/message.h" #include "sci/resource.h" #endif @@ -1199,6 +1200,20 @@ reg_t kSaveGame32(EngineState *s, int argc, reg_t *argv) { saveNo += kSaveIdShift; } + // Auto-save system used by QFG4 + if (g_sci->getGameId() == GID_QFG4) { + reg_t autoSaveNameId; + SciArray &autoSaveName = *s->_segMan->allocateArray(kArrayTypeString, 0, &autoSaveNameId); + MessageTuple autoSaveNameTuple(0, 0, 16, 1); + s->_msgState->getMessage(0, autoSaveNameTuple, autoSaveNameId); + + if (saveDescription == autoSaveName.toString()) { + saveNo = 0; + } + + s->_segMan->freeArray(autoSaveNameId); + } + Common::SaveFileManager *saveFileMan = g_sci->getSaveFileManager(); const Common::String filename = g_sci->getSavegameName(saveNo); Common::OutSaveFile *saveStream = saveFileMan->openForSaving(filename); |