From ac5aadf0e3dba5f26e9194edf53032b2333812d2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 20 Aug 2022 08:34:48 +0300 Subject: [PATCH] Add #fuzzer wiz-mode command Move the debug_fuzzer boolean out of the full options menu and turn it into #fuzzer extended command --- doc/fixes3-7-0.txt | 1 + include/optlist.h | 2 -- src/cmd.c | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 4285a3f0b..67d36cd91 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1011,6 +1011,7 @@ if a pet gelatinous cube eats a container, treat it the same as when a hostile one does: the container is destroyed but its conters are engulfed when breaking a wand of sleep hits the hero with the explosion, don't describe that as "the sleep ray hits you" +expose fuz tester to wizard-mode as #fuzzer extended command Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/include/optlist.h b/include/optlist.h index a30150236..f46b3fcc2 100644 --- a/include/optlist.h +++ b/include/optlist.h @@ -182,8 +182,6 @@ static int optfn_##a(int, int, boolean, char *, char *); Yes, Yes, No, No, NoAlias, "load DECGraphics display symbols into symset") #endif - NHOPTB(debug_fuzzer, Advanced, 0, opt_in, set_wiznofuz, - Off, Yes, No, No, NoAlias, &iflags.debug_fuzzer) NHOPTB(debug_hunger, Advanced, 0, opt_in, set_wiznofuz, Off, Yes, No, No, NoAlias, &iflags.debug_hunger) NHOPTB(debug_mongen, Advanced, 0, opt_in, set_wiznofuz, diff --git a/src/cmd.c b/src/cmd.c index fae7f9d37..261c970a0 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -114,6 +114,7 @@ static int wiz_genesis(void); static int wiz_where(void); static int wiz_detect(void); static int wiz_panic(void); +static int wiz_fuzzer(void); static int wiz_polyself(void); static int wiz_kill(void); static int wiz_load_lua(void); @@ -1534,6 +1535,17 @@ wiz_panic(void) return ECMD_OK; } +/* #fuzzer command - fuztest the program */ +static int +wiz_fuzzer(void) +{ + pline("The fuz tester will make NetHack execute random keypresses."); + pline("There is no conventional way out of this mode."); + if (paranoid_query(TRUE, "Do you want to start fuz testing?")) + iflags.debug_fuzzer = TRUE; /* Thoth, take the reins */ + return ECMD_OK; +} + /* #polyself command - change hero's form */ static int wiz_polyself(void) @@ -2515,6 +2527,8 @@ struct ext_func_tab extcmdlist[] = { dofire, 0, NULL }, { M('f'), "force", "force a lock", doforce, AUTOCOMPLETE, NULL }, + { '\0', "fuzzer", "start the fuz tester", + wiz_fuzzer, IFBURIED | WIZMODECMD | NOFUZZERCMD, NULL }, { ';', "glance", "show what type of thing a map symbol corresponds to", doquickwhatis, IFBURIED | GENERALCMD, NULL }, { '?', "help", "give a help message",