diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-30 20:30:47 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-30 20:30:47 +0200 |
commit | b86a12149ade500326a238753c31b6e0178d3b5b (patch) | |
tree | 95240fd5ea2f11bd33f731d90199a5cd89782a36 /sys/src/games/doom/m_misc.c | |
parent | 25396d3ffdebe800b373d96515a0a109b8c47a44 (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.c | 6 |
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) |