]> granicus.if.org Git - nethack/commitdiff
fix github issue #512 - fuzzer vs #exploremode
authorPatR <rankin@nethack.org>
Tue, 18 May 2021 22:41:51 +0000 (15:41 -0700)
committerPatR <rankin@nethack.org>
Tue, 18 May 2021 22:41:51 +0000 (15:41 -0700)
When the fuzzer is running, don't allow a randomly generated M-X
keystroke to switch from debug mode to explore mode.

[Unintended side-effect of the combination of two earlier changes:
assigning M-X as default key for #exploremode and allowing someone
in debug mode to voluntarily downgrade to explore mode (which should
never impact normal play and makes some types of testing simpler).]

Fixes #512

src/cmd.c

index e448cf0aa21f3ea9c3bb25246b08b28fff7c5032..35079f1a5c1e3b49f552828d668bbc8870d6cf2a 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1,4 +1,4 @@
-/* NetHack 3.7 cmd.c   $NHDT-Date: 1618175625 2021/04/11 21:13:45 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.463 $ */
+/* NetHack 3.7 cmd.c   $NHDT-Date: 1621377703 2021/05/18 22:41:43 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.464 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2013. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -728,6 +728,9 @@ domonability(void)
 int
 enter_explore_mode(void)
 {
+    if (iflags.debug_fuzzer)
+        return 0;
+
     if (discover) {
         You("are already in explore mode.");
     } else {