remove the hardcoding of qw from all but the default server gamedir. This

should take care of skin downloads when using --with-newstyle
This commit is contained in:
Bill Currie 2001-01-19 03:36:08 +00:00
parent 45c62d5923
commit 186bec3342
5 changed files with 18 additions and 11 deletions

View file

@ -28,6 +28,9 @@
/* Define this to the base game for the engine to load */ /* Define this to the base game for the engine to load */
#undef BASEGAME #undef BASEGAME
/* Define this to the base directory for the client to download skins to */
#undef SKINBASE
/* Define this to use experimental code */ /* Define this to use experimental code */
#undef _EXPERIMENTAL_ #undef _EXPERIMENTAL_

View file

@ -937,6 +937,7 @@ if test "x$newstyle" = xyes -o "x$newstyle" = "x"; then
AC_MSG_RESULT([new style]) AC_MSG_RESULT([new style])
AC_DEFINE(NEWSTYLE) AC_DEFINE(NEWSTYLE)
AC_DEFINE(BASEGAME, "base") AC_DEFINE(BASEGAME, "base")
AC_DEFINE(SKINBASE, "base")
default_globalconf="/etc/$PACKAGE.conf" default_globalconf="/etc/$PACKAGE.conf"
eval foo="$datadir" eval foo="$datadir"
default_sharepath="$foo/games/$PACKAGE" default_sharepath="$foo/games/$PACKAGE"
@ -944,6 +945,7 @@ if test "x$newstyle" = xyes -o "x$newstyle" = "x"; then
else else
AC_MSG_RESULT([old style (id Software defaults)]) AC_MSG_RESULT([old style (id Software defaults)])
AC_DEFINE(BASEGAME, "id1") AC_DEFINE(BASEGAME, "id1")
AC_DEFINE(SKINBASE, "qw")
if test "x$SYSTYPE" = xWIN32; then if test "x$SYSTYPE" = xWIN32; then
default_globalconf="%WINDIR%/$PACKAGE.conf" default_globalconf="%WINDIR%/$PACKAGE.conf"
else else

View file

@ -41,6 +41,7 @@
extern cvar_t *fs_userpath; extern cvar_t *fs_userpath;
extern cvar_t *fs_sharepath; extern cvar_t *fs_sharepath;
extern cvar_t *fs_skinbase;
extern int com_filesize; extern int com_filesize;
struct cache_user_s; struct cache_user_s;

View file

@ -448,8 +448,8 @@ CL_ParseDownload (void)
snprintf (name, sizeof (name), "%s/%s", com_gamedir, snprintf (name, sizeof (name), "%s/%s", com_gamedir,
cls.downloadtempname); cls.downloadtempname);
else else
snprintf (name, sizeof (name), "%s/qw/%s", fs_userpath->string, snprintf (name, sizeof (name), "%s/%s/%s", fs_userpath->string,
cls.downloadtempname); fs_skinbase->string, cls.downloadtempname);
COM_CreatePath (name); COM_CreatePath (name);
@ -501,10 +501,10 @@ CL_ParseDownload (void)
snprintf (newn, sizeof (newn), "%s/%s", com_gamedir, snprintf (newn, sizeof (newn), "%s/%s", com_gamedir,
cls.downloadname); cls.downloadname);
} else { } else {
snprintf (oldn, sizeof (oldn), "%s/qw/%s", fs_userpath->string, snprintf (oldn, sizeof (oldn), "%s/%s/%s", fs_userpath->string,
cls.downloadtempname); fs_skinbase->string, cls.downloadtempname);
snprintf (newn, sizeof (newn), "%s/qw/%s", fs_userpath->string, snprintf (newn, sizeof (newn), "%s/%s/%s", fs_userpath->string,
cls.downloadname); fs_skinbase->string, cls.downloadname);
} }
r = Qrename (oldn, newn); r = Qrename (oldn, newn);
if (r) if (r)

View file

@ -121,6 +121,7 @@ char gamedirfile[MAX_OSPATH];
cvar_t *fs_userpath; cvar_t *fs_userpath;
cvar_t *fs_sharepath; cvar_t *fs_sharepath;
cvar_t *fs_basegame; cvar_t *fs_basegame;
cvar_t *fs_skinbase;
int com_filesize; int com_filesize;
@ -984,9 +985,7 @@ COM_Gamedir (char *dir)
// //
Cache_Flush (); Cache_Flush ();
if (strcmp (dir, fs_basegame->string) == 0) if (strcmp (dir, fs_skinbase->string) == 0)
return;
if (strcmp (dir, "qw") == 0 && strcmp (fs_basegame->string, "id1") == 0)
return; return;
COM_AddGameDirectory (dir); COM_AddGameDirectory (dir);
@ -1056,8 +1055,8 @@ COM_Filesystem_Init (void)
COM_CreateGameDirectory (fs_basegame->string); COM_CreateGameDirectory (fs_basegame->string);
// If we're dealing with id1, use qw too // If we're dealing with id1, use qw too
if (stricmp (fs_basegame->string, "id1") == 0) { if (!strequal (fs_basegame->string, fs_skinbase->string) == 0) {
COM_CreateGameDirectory ("qw"); COM_CreateGameDirectory (fs_skinbase->string);
} }
if ((i = COM_CheckParm ("-game")) && i < com_argc - 1) { if ((i = COM_CheckParm ("-game")) && i < com_argc - 1) {
@ -1085,6 +1084,8 @@ COM_Filesystem_Init_Cvars (void)
"location of your game directories"); "location of your game directories");
fs_basegame = Cvar_Get ("fs_basegame", BASEGAME, CVAR_ROM, fs_basegame = Cvar_Get ("fs_basegame", BASEGAME, CVAR_ROM,
"game to use by default"); "game to use by default");
fs_skinbase= Cvar_Get ("fs_skinbase", SKINBASE, CVAR_ROM,
"location of skins dir for downloads");
} }
/* /*