From db24f1e068c2d4bcf6784a67f3caff0e72e9f5d2 Mon Sep 17 00:00:00 2001 From: spookypeanut Date: Mon, 25 Apr 2011 07:04:40 +0100 Subject: GROOVIE: fix for bug #3093310 Instead of crashing if the save game isn't writable, popup a gui message and then skip --- engines/groovie/script.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines') 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; -- cgit v1.2.3