fix another logic error for nowin_buf read_tribute

This commit is contained in:
nhmall
2015-06-15 23:28:41 -04:00
parent d196965397
commit 666e4976b5
2 changed files with 8 additions and 4 deletions

View File

@@ -186,7 +186,7 @@ effort to scratch it behind the two ragged bits on top of its head.
It was a relief to find someone else besides another ghost who could
see him, and Greebo, he couldn't help feeling, was a distinctly unusual
cat. Most of the castle cats were either pampered pets or flat-eared
kitchen and stable habitués who generally resembled the very rodents
kitchen and stable habitues who generally resembled the very rodents
they lived on. This cat, on the other hand, was its own animal. All
cats give that impression, of course, but instead of the mindless
animal self-absorption that passes for secret wisdom in the creatures,

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 files.c $NHDT-Date: 1434422673 2015/06/16 02:44:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.181 $ */
/* NetHack 3.6 files.c $NHDT-Date: 1434425313 2015/06/16 03:28:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.182 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3407,6 +3407,7 @@ char *nowin_buf;
boolean matchedsection = FALSE, matchedtitle = FALSE;
winid tribwin = WIN_ERR;
boolean grasped = FALSE;
boolean foundpassage = FALSE;
/* check for mandatories */
if (!tribsection || !tribtitle) {
@@ -3500,11 +3501,13 @@ char *nowin_buf;
if (matchedtitle && (passagenum == targetpassage)) {
if (!nowin_buf)
tribwin = create_nhwindow(NHW_MENU);
else
foundpassage = TRUE;
}
}
} else if (!strncmpi(&line[1], "e ", sizeof("e ") - 1)) {
if (matchedtitle && (scope == PASSAGESCOPE)
&& ((!nowin_buf && tribwin != WIN_ERR) || nowin_buf))
&& ((!nowin_buf && tribwin != WIN_ERR) || (nowin_buf && foundpassage)))
goto cleanup;
if (scope == TITLESCOPE)
matchedtitle = FALSE;
@@ -3553,7 +3556,8 @@ cleanup:
if (!nowin_buf)
pline("It seems to be %s of \"%s\"!", badtranslation, tribtitle);
else
grasped = TRUE;
if (foundpassage)
grasped = TRUE;
}
return grasped;
}