diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 5c8179103c..dd9241a375 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -531,6 +531,12 @@ reg_t kSaveGame(EngineState *s, int argc, reg_t *argv) { debug(3, "kSaveGame(%s,%d,%s,%s)", game_id.c_str(), virtualId, game_description.c_str(), version.c_str()); + // We check here, we don't want to delete a users save in case we are within a kernel function + if (s->executionStackBase) { + warning("kSaveGame - won't save from within kernel function"); + return NULL_REG; + } + Common::Array<SavegameDesc> saves; listSavegames(saves); diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 0fe5f2088a..5690969065 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -722,6 +722,7 @@ bool gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savenam meta.script0_size = script0->size; meta.game_object_offset = g_sci->getGameObject().offset; + // Checking here again if (s->executionStackBase) { warning("Cannot save from below kernel function"); return false; |