From d6800663435123024393f872b5d4df206cced979 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 10 Dec 2018 02:21:31 -0800 Subject: [PATCH] fix #H7704 - clairvoyance: objects vs pools When clairvoyance revealed an underwater object and the player wasn't being given a chance to browse for some other reason, the map didn't get refreshed and the object stayed displayed with the water hidden under it. Force a chance to browse when revealing underwater objects despite that being intrusive when clairvoyance kicks in while walking around. --- doc/fixes36.2 | 2 ++ src/detect.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index ae20cf33c..9e6b004bb 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -266,6 +266,8 @@ when blocking/unblocking of levitation or flying was updated due to walking if levitating hero poly'd into pass-wall creature jumped or teleported from terrain that allowed levitation to terrain that didn't or vice versa, blocking of levitation wasn't updated properly +clairvoyance revealing underwater or under-lava objects left object displayed + instead of restoring the water or lava Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/detect.c b/src/detect.c index 416c2611f..e6c5778af 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 detect.c $NHDT-Date: 1542853884 2018/11/22 02:31:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.87 $ */ +/* NetHack 3.6 detect.c $NHDT-Date: 1544437284 2018/12/10 10:21:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1308,7 +1308,8 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */ struct obj *otmp; long save_EDetect_mons; char save_viz_uyux; - boolean unconstrained, refresh = FALSE, mdetected = FALSE, + boolean unconstrained, refresh = FALSE, + mdetected = FALSE, odetected = FALSE, /* fake spellbook 'sobj' implies hero has cast the spell; when book is blessed, casting is skilled or expert level; if already clairvoyant, non-skilled spell acts like skilled */ @@ -1363,6 +1364,10 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */ if (extended) otmp->dknown = 1; map_object(otmp, TRUE); + newglyph = glyph_at(zx, zy); + /* if otmp is underwater, we'll need to redisplay the water */ + if (newglyph != oldglyph && covers_objects(zx, zy)) + odetected = TRUE; } /* if there is a monster here, see or detect it, possibly as "remembered, unseen monster" */ @@ -1385,7 +1390,7 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */ } } - if (!level.flags.hero_memory || unconstrained || mdetected) { + if (!level.flags.hero_memory || unconstrained || mdetected || odetected) { flush_screen(1); /* flush temp screen */ /* the getpos() prompt from browse_map() is only shown when flags.verbose is set, but make this unconditional so that -- 2.49.0