From: PatR Date: Sun, 9 Apr 2017 02:39:43 +0000 (-0700) Subject: autodescribe vs detection X-Git-Tag: NetHack-3.6.1_RC01~504 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5cb4168c580ceffb94d4b492ec47f27ebc8b98ed;p=nethack autodescribe vs detection Temporary map views for detection or #terrain allow moving the cursor around to get the brief location description provided by getpos's autodescribe feature and were doing so by forcing the 'autodescribe' option to True, then leaving it that way. Save the option value prior to such operations and restore it after instead of leaving it changed. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 5ad9d072a..ce42dc224 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -404,6 +404,8 @@ artifact creation violated illiterate conduct when artifact name was assigned, behavior intended only for creating Sting or Orcrist via naming tty: revert to pline() for issuing prompts (override MSGTYPE=hide differently) previous tty-revert fix had the override test backwards, breaking MSGTYPE +save 'autodescribe' option value prior to detection or #terrain display and + restore it after rather than leave it forced on Platform- and/or Interface-Specific Fixes diff --git a/src/detect.c b/src/detect.c index a46cf47f9..def22469e 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 detect.c $NHDT-Date: 1463191981 2016/05/14 02:13:01 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.70 $ */ +/* NetHack 3.6 detect.c $NHDT-Date: 1491705573 2017/04/09 02:39:33 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.76 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -59,13 +59,15 @@ int ter_typ; const char *ter_explain; { coord dummy_pos; /* don't care whether player actually picks a spot */ + boolean save_autodescribe; dummy_pos.x = u.ux, dummy_pos.y = u.uy; /* starting spot for getpos() */ + save_autodescribe = iflags.autodescribe; iflags.autodescribe = TRUE; iflags.terrainmode = ter_typ; getpos(&dummy_pos, FALSE, ter_explain); iflags.terrainmode = 0; - /* leave iflags.autodescribe 'on' even if previously 'off' */ + iflags.autodescribe = save_autodescribe; } /* extracted from monster_detection() so can be shared by do_vicinity_map() */