Skip to content

Commit

Permalink
Merge branch 'pr-check-game'
Browse files Browse the repository at this point in the history
  • Loading branch information
Diordany committed Jun 6, 2024
2 parents 152ba8e + d354b52 commit 3a92dc3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Quake/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,6 @@ static void COM_Game_f (void)
{
if (Cmd_Argc() > 1)
{
char newgamedir[MAX_OSPATH];
const char *p = Cmd_Argv(1);
const char *p2 = Cmd_Argv(2);
searchpath_t *search;
Expand Down Expand Up @@ -2190,15 +2189,16 @@ static void COM_Game_f (void)
}
}

q_strlcpy (newgamedir, va("%s/%s", com_basedir, p), sizeof(newgamedir));

if (Sys_FileType(newgamedir) != FS_ENT_DIRECTORY)
if (Sys_FileType(va("%s/%s", com_basedir, p)) != FS_ENT_DIRECTORY)
{
Con_Printf("The game '%s' couldn't be found.\n", p);
return;
if (host_parms->userdir == host_parms->basedir || (Sys_FileType(va("%s/%s", host_parms->userdir, p)) != FS_ENT_DIRECTORY))
{
Con_Printf ("No such game directory \"%s\"\n", p);
return;
}
}

if (!Q_strcmp(p, COM_SkipPath(com_gamedir))) //no change
if (!q_strcasecmp(p, COM_SkipPath(com_gamedir))) //no change
{
if (com_searchpaths->path_id > 1) { //current game not id1
if (*p2 && com_searchpaths->path_id == 2) {
Expand Down

0 comments on commit 3a92dc3

Please sign in to comment.