diff options
| author | spookypeanut | 2011-04-25 07:04:40 +0100 | 
|---|---|---|
| committer | spookypeanut | 2011-04-25 08:51:21 +0100 | 
| commit | db24f1e068c2d4bcf6784a67f3caff0e72e9f5d2 (patch) | |
| tree | 63d0e6add29e92f22325480b101ad99d8a4eb94c | |
| parent | 1d58ccac8172d81c4e4a983e148ebd7929b9a5a5 (diff) | |
| download | scummvm-rg350-db24f1e068c2d4bcf6784a67f3caff0e72e9f5d2.tar.gz scummvm-rg350-db24f1e068c2d4bcf6784a67f3caff0e72e9f5d2.tar.bz2 scummvm-rg350-db24f1e068c2d4bcf6784a67f3caff0e72e9f5d2.zip | |
GROOVIE: fix for bug #3093310
Instead of crashing if the save game isn't writable, popup a
gui message and then skip
| -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; | 
