From 383693bad415070e20b66d105d9a6147fd27a39a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 20 Oct 2011 23:05:52 +0000 Subject: Fix bug with Hexen savedir set to "(null)" by setup tool (thanks Alexandre Xavier). Subversion-branch: /branches/v2-branch Subversion-revision: 2447 --- src/setup/mode.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/setup/mode.c') diff --git a/src/setup/mode.c b/src/setup/mode.c index 53a74314..88924ad8 100644 --- a/src/setup/mode.c +++ b/src/setup/mode.c @@ -128,6 +128,20 @@ static void BindMiscVariables(void) { M_BindVariable("savedir", &savedir); M_BindVariable("messageson", &showMessages); + + // Hexen has a variable to control the savegame directory + // that is used. + + savedir = M_GetSaveGameDir("hexen.wad"); + + // On Windows, hexndata\ is the default. + + if (!strcmp(savedir, "")) + { + free(savedir); + savedir = malloc(10); + sprintf(savedir, "hexndata%c", DIR_SEPARATOR); + } } if (gamemission == strife) -- cgit v1.2.3