From 1f707225e3b3ec8499b2333f7eaa1aa133239567 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 19 Feb 2022 20:49:49 +0000 Subject: [PATCH] cmdlist now accepts wildcards. qqshaka was the first to notice it previously sucked. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6195 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/cmd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/common/cmd.c b/engine/common/cmd.c index b86479bdf..11a9fbeb2 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -2622,10 +2622,16 @@ static void Cmd_List_f (void) { cmd_function_t *cmd; int num=0; + const char *search = (Cmd_Argc()>1)?Cmd_Argv(1):NULL; for (cmd=cmd_functions ; cmd ; cmd=cmd->next) { if ((cmd->restriction?cmd->restriction:rcon_level.ival) > Cmd_ExecLevel) continue; + + if (search) + if (!wildcmp(search, cmd->name)) + continue; //nope, no match + if (!num) Con_TPrintf("Command list:\n"); Con_Printf("(%2i) %s\n", (int)(cmd->restriction?cmd->restriction:rcon_level.ival), cmd->name);