]> granicus.if.org Git - nethack/commitdiff
fix #H4039 - symset:default
authorPatR <rankin@nethack.org>
Fri, 11 Dec 2015 10:36:56 +0000 (02:36 -0800)
committerPatR <rankin@nethack.org>
Fri, 11 Dec 2015 10:36:56 +0000 (02:36 -0800)
Options parsing didn't support "default" (shown by the 'O' command)
or "Default symbols" (menu entry for choosing a symbol set via the
'O' command.  Symbol handling is somewhat confusing, but this seems to
do the trick.  They can't be truncated, but they're case-insensitive,
and "Default" and "symbols" can be separated by dash or underscore as
well as space, or run-together with no separator.

doc/fixes36.1
src/files.c
src/options.c

index 5dee5921f016bb6273f13fdaf33e5e9004b51940..87fa716845e7095d4c6a7845d845376893aeff47 100644 (file)
@@ -9,6 +9,9 @@ update MAXPLAYERS documentation in sysconf file and allow 0 for it
 wizard mode: don't include feedback about named fruit for ^X and enlightenment
 looking at distant objects while wearing the Eyes of the Overworld made their
        up-close descriptions known when not intended
+message when cursed wand zapped by a monster happens to explode was suppressed
+       if hero was deaf, even though that message has no audible component
+support explicit 'symset:default' and 'symset:Default symbols' in options
 
 
 Platform- and/or Interface-Specific Fixes
index 7699ee1cc43fd39ece1be89dc96c451a50176b8e..58691c1851229ecf5e45e20836906baaf12bba1f 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 files.c $NHDT-Date: 1449296293 2015/12/05 06:18:13 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.192 $ */
+/* NetHack 3.6 files.c $NHDT-Date: 1449830204 2015/12/11 10:36:44 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.194 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -2783,8 +2783,17 @@ int which_set;
         }
     }
     (void) fclose(fp);
-    if (!chosen_symset_end && !chosen_symset_start)
+    if (!chosen_symset_start && !chosen_symset_end) {
+        /* name caller put in symset[which_set].name was not found;
+           if it looks like "Default symbols", null it out and return
+           success to use the default; otherwise, return failure */
+        if (symset[which_set].name
+            && (fuzzymatch(symset[which_set].name, "Default symbols",
+                           " -_", TRUE)
+                || !strcmpi(symset[which_set].name, "default")))
+            clear_symsetentry(which_set, TRUE);
         return (symset[which_set].name == 0) ? 1 : 0;
+    }
     if (!chosen_symset_end) {
         raw_printf("Missing finish for symset \"%s\"",
                    symset[which_set].name ? symset[which_set].name
index 87c40042f51df7b9625d017cd4a4c250762848e8..e48194503286af91933a17f2c51d5e29bb2bbf9a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 options.c       $NHDT-Date: 1448241657 2015/11/23 01:20:57 $  $NHDT-Branch: master $:$NHDT-Revision: 1.243 $ */
+/* NetHack 3.6 options.c       $NHDT-Date: 1449830206 2015/12/11 10:36:46 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.244 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -2010,7 +2010,7 @@ boolean tinitial, tfrom_file;
                            op, SYMBOLS);
                 wait_synch();
             } else {
-                switch_symbols(TRUE);
+                switch_symbols(symset[PRIMARY].name != (char *) 0);
                 need_redraw = TRUE;
             }
         }