From 23532b012b1cddae8ac06ff98b61fd000529e91f Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 17 Aug 2024 11:19:45 -0700 Subject: [PATCH] farlook of "`" Allow farlook/quicklook to step through all engravings--corridor ones as well as room ones--with repeated '`' when picking location with getpos(), similar to how repeated '^' goes through all traps no matter what display character they use. It isn't possible to look at corridor engravings by using their default symbol '#'. It is possible by using 'a' for "anything of interest" but that matches lots of other stuff. This tries to add an NHDT tags line to sym.h. That was followed by 'git nhadd' which did stage it for commit, but date/branch/revision tag expansion isn't working. I did something similar to defsym.h about 5 weeks ago; that one worked and I don't recall having needed to do anything special. --- include/sym.h | 3 ++- src/getpos.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/sym.h b/include/sym.h index 44efaffe7..d965ec2ff 100644 --- a/include/sym.h +++ b/include/sym.h @@ -1,4 +1,4 @@ -/* NetHack 3.7 sym.h */ +/* NetHack 3.7 sym.h $NHDT-Date: $ $NHDT-Branch: $ $NHDT-Revision: $ */ /* Copyright (c) 2016 by Pasi Kallinen */ /* NetHack may be freely redistributed. See license for details. */ @@ -105,6 +105,7 @@ struct symsetentry { #define is_cmap_water(i) ((i) == S_pool || (i) == S_water) #define is_cmap_lava(i) ((i) == S_lava || (i) == S_lavawall) #define is_cmap_stairs(i) ((i) >= S_upstair && (i) <= S_brdnladder) +#define is_cmap_engraving(i) ((i) == S_engroom || (i) == S_engrcorr) /* misc symbol definitions */ enum misc_symbols { diff --git a/src/getpos.c b/src/getpos.c index 3457d70e7..1e0c813d2 100644 --- a/src/getpos.c +++ b/src/getpos.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 getpos.c $NHDT-Date: 1708126536 2024/02/16 23:35:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.307 $ */ +/* NetHack 3.7 getpos.c $NHDT-Date: 1723875487 2024/08/17 06:18:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $ */ /*-Copyright (c) Pasi Kallinen, 2023. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1033,7 +1033,11 @@ getpos(coord *ccp, boolean force, const char *goal) || c == (int) gs.showsyms[sidx] /* have '^' match webs and vibrating square or any other trap that uses something other than '^' */ - || (c == '^' && is_cmap_trap(sidx))) + || (c == '^' && is_cmap_trap(sidx)) + /* have room engraving character (default '`') + match corridor engravings (default '#') too */ + || (c == gs.showsyms[S_engroom] + && is_cmap_engraving(sidx))) matching[sidx] = (char) ++k; } if (k) {