Skip to content

Commit

Permalink
general: allow same fs_homepath and fs_basepath for dedicated servers
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSimek committed Jan 30, 2013
1 parent cd66177 commit 5fe6056
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/qcommon/files.c
Expand Up @@ -707,7 +707,7 @@ int FS_SV_FOpenFileRead(const char *filename, fileHandle_t *fp)
fsh[f].handleSync = qfalse;
if (!fsh[f].handleFiles.file.o)
{
// If fs_homepath == fs_basepath, don't bother --- ET:L: we shouldn't have this case anymore
// If fs_homepath == fs_basepath, don't bother (dedicated server)
// FIXME: use FS_PathCmp() (slashes, low/big letters ... trailing slash)
if (Q_stricmp(fs_homepath->string, fs_basepath->string))
{
Expand Down Expand Up @@ -3432,8 +3432,11 @@ static void FS_Startup(const char *gameName)
homePath = Sys_DefaultHomePath(); // Returns My Documents path on windows now ex: C:\Users\username\Documents where also other games add their data
if (!homePath || !homePath[0])
{
//homePath = fs_basepath->string; // we do no longer support home == base
#ifdef DEDICATED
homePath = fs_basepath->string;
#else
Com_Error(ERR_FATAL, "FS_Startup: Default home path is empty.\n");
#endif
}

fs_homepath = Cvar_Get("fs_homepath", homePath, CVAR_INIT);
Expand Down Expand Up @@ -3504,12 +3507,14 @@ static void FS_Startup(const char *gameName)
#endif
Com_Printf("%d files in pk3 files\n", fs_packFiles);

// don't start if base == home
#ifndef DEDICATED
// don't start if base == home, so downloads won't overwrite original files
if (FS_PathCmp(fs_homepath->string, fs_basepath->string) == 0)
{
Com_Error(ERR_FATAL, "FS_Startup: fs_homepath and fs_basepath are identical - set different pathes!\n");
// Note: if both are same - crashlog.txt is written into (fs_homepath)
Com_Error(ERR_FATAL, "FS_Startup: fs_homepath and fs_basepath are identical - set different paths!\n");
// NOTE: if both are same - crashlog.txt is written into (fs_homepath)
}
#endif
}

/*
Expand Down

0 comments on commit 5fe6056

Please sign in to comment.