From a3e68d7a2cfe39adb2d1ddc8a51ff47446891795 Mon Sep 17 00:00:00 2001 From: Diordany van Hemert Date: Mon, 25 Dec 2023 01:02:50 +0100 Subject: [PATCH] Check if the requested game exists --- Quake/common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Quake/common.c b/Quake/common.c index 5e32afa6b..6f6ac8259 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -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 {