]> granicus.if.org Git - nethack/commitdiff
Add #fuzzer wiz-mode command
authorPasi Kallinen <paxed@alt.org>
Sat, 20 Aug 2022 05:34:48 +0000 (08:34 +0300)
committerPasi Kallinen <paxed@alt.org>
Sat, 20 Aug 2022 05:34:52 +0000 (08:34 +0300)
Move the debug_fuzzer boolean out of the full options menu
and turn it into #fuzzer extended command

doc/fixes3-7-0.txt
include/optlist.h
src/cmd.c

index 4285a3f0b0ba394042dee176306074c60a063cd9..67d36cd91fce4087792ec1ae66d07b603d1d956a 100644 (file)
@@ -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
index a301502361212e985bd03f16fa73071520a859bf..f46b3fcc23eaafd0982d938569606882144e52a8 100644 (file)
@@ -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,
index fae7f9d37e9c1a2c6d69bbcf8a54754f7e427204..261c970a06148f9d91a17d885baa09248132ea4e 100644 (file)
--- 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",