fix #7501 - searching while blind

My "fix github issue #38 - indentation vs 'if {}'" patch, commit
d2ae45984e, broke finding unseen
monsters via searching.  Most notable if blind, but applied to
invisible monsters too.
This commit is contained in:
PatR
2018-11-01 17:37:47 -07:00
parent 0ea7fbad7a
commit ac81022eed
2 changed files with 11 additions and 8 deletions
+1
View File
@@ -194,6 +194,7 @@ simplify #wizidentify; don't rely on having bold menu entries
ensure tmp_at() structures are initialized for all code paths when swallowed ensure tmp_at() structures are initialized for all code paths when swallowed
trapped-vs-levitation/flying change broke Sting releasing hero from web trapped-vs-levitation/flying change broke Sting releasing hero from web
life-saving while poly'd and Unchanging wasn't restoring u.mh (HP as monster) life-saving while poly'd and Unchanging wasn't restoring u.mh (HP as monster)
change in searching stopped finding unseen monsters except hiders and eels
tty: turn off an optimization that is the suspected cause of Windows reported tty: turn off an optimization that is the suspected cause of Windows reported
partial status lines following level changes partial status lines following level changes
tty: ensure that current status fields are always copied to prior status tty: ensure that current status fields are always copied to prior status
+10 -8
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 detect.c $NHDT-Date: 1539908137 2018/10/19 00:15:37 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.83 $ */ /* NetHack 3.6 detect.c $NHDT-Date: 1541119051 2018/11/02 00:37:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.84 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1548,14 +1548,16 @@ boolean via_warning;
if (mtmp->m_ap_type) { if (mtmp->m_ap_type) {
seemimic(mtmp); seemimic(mtmp);
found_something = TRUE; found_something = TRUE;
} else if (mtmp->mundetected } else {
&& (is_hider(mtmp->data) || mtmp->data->mlet == S_EEL)) { if (mtmp->mundetected
if (via_warning) { && (is_hider(mtmp->data) || mtmp->data->mlet == S_EEL)) {
Your("warning senses cause you to take a second %s.", if (via_warning) {
Blind ? "to check nearby" : "look close by"); Your("warning senses cause you to take a second %s.",
display_nhwindow(WIN_MESSAGE, FALSE); /* flush messages */ Blind ? "to check nearby" : "look close by");
display_nhwindow(WIN_MESSAGE, FALSE); /* flush messages */
}
mtmp->mundetected = 0;
} }
mtmp->mundetected = 0;
newsym(x, y); newsym(x, y);
found_something = TRUE; found_something = TRUE;
} }