summaryrefslogtreecommitdiff
path: root/sys/src/games/doom/m_misc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-07-30 20:30:47 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-07-30 20:30:47 +0200
commitb86a12149ade500326a238753c31b6e0178d3b5b (patch)
tree95240fd5ea2f11bd33f731d90199a5cd89782a36 /sys/src/games/doom/m_misc.c
parent25396d3ffdebe800b373d96515a0a109b8c47a44 (diff)
games/doom: fix config file never being loaded or saved (thanks qu7uux)
basedefault[], the default path to the config file, is never set and remains blank, unless -config %s is used (cd d_main.c). when games/doom attempts to open the file, it silently fails and no config file is ever read or written. this patch sets basedefault to a file in whatever directory a valid wad is found in I_IdentifyWAD().
Diffstat (limited to 'sys/src/games/doom/m_misc.c')
-rw-r--r--sys/src/games/doom/m_misc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/src/games/doom/m_misc.c b/sys/src/games/doom/m_misc.c
index ca3d5ccec..3d9988d46 100644
--- a/sys/src/games/doom/m_misc.c
+++ b/sys/src/games/doom/m_misc.c
@@ -300,13 +300,11 @@ void M_LoadDefaults (void)
// check for a custom default file
i = M_CheckParm ("-config");
if (i && i<myargc-1)
- {
defaultfile = myargv[i+1];
- printf (" default file: %s\n",defaultfile);
- }
else
defaultfile = basedefault;
-
+ printf (" default file: %s\n",defaultfile);
+
// read the file in, overriding any set defaults
f = fopen (defaultfile, "r");
if (f)