From 7ca9d0698fa02d584d583bde84838a479311cb55 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 9 May 2021 13:01:21 +0000 Subject: [PATCH] I really do not trust nquake's configs. Completely refuse to exec them, at least when warnings are silenced (so manual attempts will still work). git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5840 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/cmd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/engine/common/cmd.c b/engine/common/cmd.c index e7b0783b9..32855a364 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -806,7 +806,7 @@ static void Cmd_Exec_f (void) //hack to try to work around nquake's b0rkedness if (!strncmp(s, "// This is nQuake's Frogbot config", 33)) { - s = "echo Refusing to exec nQuake's Frogbot config"; //otherwise many people with nquake installed will be fucked over whenever they try playing singleplayer + s = va("echo \""CON_ERROR"Refusing to exec nQuake's %s\"", buf); //otherwise many people with nquake installed will be fucked over whenever they try playing singleplayer Cbuf_InsertText (s, level, true); } else @@ -848,6 +848,16 @@ static void Cmd_Exec_f (void) } break; } + + #ifdef HAVE_CLIENT + if (!cl_warncmd.ival && foundone && (!strcmp(name, "quake.rc") || !strcmp(name, "default.cfg") || !strcmp(name, "autoexec.cfg"))) + { + Menu_Prompt(NULL, NULL, va("WARNING: nquake %s file detected. The file has been ignored.", name), NULL, NULL, "Argh"); + *s = 0; + foundone = 0; + } + #endif + Cbuf_InsertText (s, level, true); if (foundone) Cbuf_InsertText(va("\necho \""CON_ERROR"fixups for nquake config %s: %i replacements\"\n", buf, foundone), level, false);