mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Fail loudly when config isn't writable
This commit is contained in:
parent
34fd13be14
commit
7f46eb72bc
1 changed files with 14 additions and 0 deletions
14
src/d_main.c
14
src/d_main.c
|
@ -999,6 +999,7 @@ void D_SRB2Main(void)
|
||||||
lumpinfo_t *lumpinfo;
|
lumpinfo_t *lumpinfo;
|
||||||
UINT16 wadnum;
|
UINT16 wadnum;
|
||||||
char *name;
|
char *name;
|
||||||
|
FILE *tmpfile;
|
||||||
|
|
||||||
INT32 pstartmap = 1;
|
INT32 pstartmap = 1;
|
||||||
boolean autostart = false;
|
boolean autostart = false;
|
||||||
|
@ -1126,6 +1127,19 @@ void D_SRB2Main(void)
|
||||||
|
|
||||||
configfile[sizeof configfile - 1] = '\0';
|
configfile[sizeof configfile - 1] = '\0';
|
||||||
|
|
||||||
|
// If config isn't writable, tons of behavior will be broken.
|
||||||
|
// Fail loudly before things get confusing!
|
||||||
|
tmpfile = fopen(configfile, "w");
|
||||||
|
if (!tmpfile)
|
||||||
|
{
|
||||||
|
#if defined (_WIN32)
|
||||||
|
I_Error("Couldn't write game config.\nMake sure the game is installed somewhere it has write permissions.\n\n(Don't use the Downloads folder, Program Files, or your desktop!\nIf unsure, we recommend making a subfolder in your Documents folder.)");
|
||||||
|
#else
|
||||||
|
I_Error("Couldn't write game config.\nMake sure you've installed the game somewhere it has write permissions.");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
fclose(tmpfile);
|
||||||
|
|
||||||
#ifdef _arch_dreamcast
|
#ifdef _arch_dreamcast
|
||||||
strcpy(downloaddir, "/ram"); // the dreamcast's TMP
|
strcpy(downloaddir, "/ram"); // the dreamcast's TMP
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue