mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2025-01-19 07:31:04 +00:00
- Confirm patch setting writedir for mods. (Ludwig Nussel)
(icculus patchset #13,#14)
This commit is contained in:
parent
1a3d53810a
commit
8cf067fc33
1 changed files with 13 additions and 16 deletions
29
src/files.c
29
src/files.c
|
@ -550,27 +550,25 @@ FS_AddHomeAsGameDirectory
|
|||
Use ~/.quake2/dir as fs_gamedir
|
||||
============
|
||||
*/
|
||||
void FS_AddHomeAsGameDirectory (char *dir)
|
||||
{
|
||||
void FS_AddHomeAsGameDirectory (char * dir) {
|
||||
#ifndef _WIN32
|
||||
char gdir[MAX_OSPATH];
|
||||
char *homedir = getenv( "HOME" );
|
||||
char gdir[MAX_OSPATH];
|
||||
char * homedir = getenv("HOME");
|
||||
|
||||
if(homedir)
|
||||
{
|
||||
int len = snprintf(gdir, sizeof(gdir), "%s/.quake2/%s/", homedir, dir);
|
||||
if (homedir) {
|
||||
int len = snprintf(gdir, sizeof(gdir), "%s/.quake2/%s/", homedir, dir);
|
||||
|
||||
Com_Printf("using %s for writing\n",gdir);
|
||||
FS_CreatePath (gdir);
|
||||
Com_Printf("using %s for writing\n",gdir);
|
||||
FS_CreatePath (gdir);
|
||||
|
||||
if ((len > 0) && (len < sizeof(gdir)) && (gdir[len-1] == '/'))
|
||||
gdir[len-1] = 0;
|
||||
if ((len > 0) && (len < sizeof(gdir)) && (gdir[len-1] == '/'))
|
||||
gdir[len-1] = 0;
|
||||
|
||||
strncpy(fs_gamedir,gdir,sizeof(fs_gamedir)-1);
|
||||
fs_gamedir[sizeof(fs_gamedir)-1] = 0;
|
||||
strncpy(fs_gamedir,gdir,sizeof(fs_gamedir)-1);
|
||||
fs_gamedir[sizeof(fs_gamedir)-1] = 0;
|
||||
|
||||
FS_AddGameDirectory (gdir);
|
||||
}
|
||||
FS_AddGameDirectory (gdir);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -662,7 +660,6 @@ void FS_SetGamedir (char *dir)
|
|||
if (dedicated && !dedicated->value)
|
||||
Cbuf_AddText ("vid_restart\nsnd_restart\n");
|
||||
|
||||
|
||||
// now add new entries for
|
||||
if (!strcmp(dir,BASEDIRNAME) || (*dir == 0))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue