diff options
-rw-r--r-- | engines/groovie/script.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 9b58f8bd5a..8c7d3b0824 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -39,6 +39,8 @@ #include "common/EventRecorder.h" #include "common/macresman.h" +#include "gui/message.h" + #define NUM_OPCODES 90 namespace Groovie { @@ -411,6 +413,13 @@ void Script::savegame(uint slot) { char newchar; Common::OutSaveFile *file = SaveLoad::openForSaving(ConfMan.getActiveDomainName(), slot); + if (!file) { + debugC(9, kGroovieDebugScript, "Save file pointer is null"); + GUI::MessageDialog dialog("Failed to save game", "OK"); + dialog.runModal(); + return; + } + // Saving the variables. It is endian safe because they're byte variables file->write(_variables, 0x400); delete file; |