Skip to content

Commit

Permalink
Check if the requested game exists
Browse files Browse the repository at this point in the history
Co-authored-by: Ozkan Sezer <[email protected]>
  • Loading branch information
Diordany and sezero committed Jun 6, 2024
1 parent 17bad80 commit d354b52
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Quake/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,15 @@ static void COM_Game_f (void)
}
}

if (Sys_FileType(va("%s/%s", com_basedir, p)) != FS_ENT_DIRECTORY)
{
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_strcasecmp(p, COM_SkipPath(com_gamedir))) //no change
{
if (com_searchpaths->path_id > 1) { //current game not id1
Expand Down

0 comments on commit d354b52

Please sign in to comment.