diff --git a/src/kernel/save.c b/src/kernel/save.c index c1bf3eaa3..e99ad2612 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -81,7 +81,7 @@ #define MAXPERSISTENT 128 /* exported symbols symbols */ -int firstx = 0, firsty = 0; +int g_writegame = 1; static void read_alliances(gamedata *data) { @@ -1719,6 +1719,9 @@ int writegame(const char *filename) stream strm; FILE *F; + if (g_writegame == 0) { + return -1; + } create_directories(); path_join(datapath(), filename, path, sizeof(path)); /* make sure we don't overwrite an existing file (hard links) */ diff --git a/src/kernel/save.h b/src/kernel/save.h index 8c000e911..267430a40 100644 --- a/src/kernel/save.h +++ b/src/kernel/save.h @@ -23,7 +23,7 @@ extern "C" { * dass hier ein Fehler (fehlende ") vorliegt */ /* TODO: is this *really* still in use? */ - extern int enc_gamedata; + extern int g_writegame; int readgame(const char *filename); int writegame(const char *filename); diff --git a/src/main.c b/src/main.c index 9cf76f262..b937c80fa 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -196,6 +197,9 @@ static int parse_args(int argc, char **argv) else { const char *arg; switch (argi[1]) { + case 'D': + g_writegame = 0; + break; case 'c': i = get_arg(argc, argv, 2, i, &arg, 0); config_set("config.path", arg);