From 014547beb2f8c48b34a89cf5d5b61c36916a1603 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 4 Jun 2015 15:36:26 +0300 Subject: [PATCH] Fix looking around when swallowed From Boudewijn: > I am currently swallowed by an ice vortex, and used the ; command > to identify the \ on my top right. > > It said: "\ an opulent throne (interior of a monster)" Now, when you're swallowed, and look at anything else than yourself, you'll get "\ the interior of a monster (interior of an ice vortex)". Based on the comment in the code, it seems this was the original intention anyway. --- src/pager.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/pager.c b/src/pager.c index aa7e7ecbd..9fe15d724 100644 --- a/src/pager.c +++ b/src/pager.c @@ -544,6 +544,22 @@ const char **firstmatch; * When all have been checked then the string is printed. */ + /* + * Special case: if identifying from the screen, and we're swallowed, + * and looking at something other than our own symbol, then just say + * "the interior of a monster". + */ + if (u.uswallow && (looked) && (is_swallow_sym(sym) || (int)showsyms[S_stone] == sym)) { + if (!found) { + Sprintf(out_str, "%s%s", prefix, mon_interior); + *firstmatch = mon_interior; + } else { + found += append_str(out_str, mon_interior); + } + need_to_look = TRUE; + goto didlook; + } + /* Check for monsters */ for (i = 0; i < MAXMCLASSES; i++) { if (sym == ((looked) ? showsyms[i + SYM_OFF_M] : def_monsyms[i].sym) @@ -567,21 +583,6 @@ const char **firstmatch; && !(Race_if(PM_HUMAN) || Race_if(PM_ELF)) && !Upolyd) found += append_str(out_str, "you"); /* tack on "or you" */ - /* - * Special case: if identifying from the screen, and we're swallowed, - * and looking at something other than our own symbol, then just say - * "the interior of a monster". - */ - if (u.uswallow && (looked) && is_swallow_sym(sym)) { - if (!found) { - Sprintf(out_str, "%s%s", prefix, mon_interior); - *firstmatch = mon_interior; - } else { - found += append_str(out_str, mon_interior); - } - need_to_look = TRUE; - } - /* Now check for objects */ for (i = 1; i < MAXOCLASSES; i++) { if (sym @@ -696,6 +697,7 @@ const char **firstmatch; * If we are looking at the screen, follow multiple possibilities or * an ambiguous explanation by something more detailed. */ + didlook: if (looked) { if (found > 1 || need_to_look) { char monbuf[BUFSZ];