Skip to content

Commit

Permalink
Check if the requested game exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Diordany committed Dec 25, 2023
1 parent 9785099 commit a3e68d7
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 @@ -2161,9 +2161,18 @@ 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;

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

if (Sys_FileType(newgamedir) == FS_ENT_NONE)
{
Con_Printf("The game '%s' couldn't be found.\n", p);
return;
}

if (!registered.value) //disable shareware quake
{
Expand Down

0 comments on commit a3e68d7

Please sign in to comment.