allow monster that has swallowed hero to be named

This commit is contained in:
nhmall
2023-11-10 16:35:43 -05:00
parent 4512ae5bbe
commit f360cb24b1
2 changed files with 16 additions and 2 deletions

View File

@@ -1278,6 +1278,8 @@ make spell menu work with repeat
when attempting to look up a named fruit in data.base, try harder
set and check mon->mstate flags more consistently
fix sanity error when cloud was created over an engraving
docall naming of the monster that currently has the hero swallowed by
using their visible interior
Fixes to 3.7.0-x General Problems Exposed Via git Repository

View File

@@ -1335,6 +1335,7 @@ do_mgivenname(void)
coord cc;
int cx, cy;
struct monst *mtmp = 0;
boolean do_swallow = FALSE;
if (Hallucination) {
You("would never recognize it anyway.");
@@ -1358,12 +1359,23 @@ do_mgivenname(void)
} else
mtmp = m_at(cx, cy);
if (!mtmp
/* Allow you to name the monster that has swallowed you */
if (!mtmp && u.uswallow) {
int glyph = glyph_at(cx, cy);
if (glyph_is_swallow(glyph)) {
mtmp = u.ustuck;
do_swallow = TRUE;
}
}
if (!do_swallow && (!mtmp
|| (!sensemon(mtmp)
&& (!(cansee(cx, cy) || see_with_infrared(mtmp))
|| mtmp->mundetected || M_AP_TYPE(mtmp) == M_AP_FURNITURE
|| M_AP_TYPE(mtmp) == M_AP_OBJECT
|| (mtmp->minvis && !See_invisible)))) {
|| (mtmp->minvis && !See_invisible))))) {
pline("I see no monster there.");
return;
}