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.
This commit is contained in:
+17
-15
@@ -544,6 +544,22 @@ const char **firstmatch;
|
|||||||
* When all have been checked then the string is printed.
|
* 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 */
|
/* Check for monsters */
|
||||||
for (i = 0; i < MAXMCLASSES; i++) {
|
for (i = 0; i < MAXMCLASSES; i++) {
|
||||||
if (sym == ((looked) ? showsyms[i + SYM_OFF_M] : def_monsyms[i].sym)
|
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)
|
&& !(Race_if(PM_HUMAN) || Race_if(PM_ELF)) && !Upolyd)
|
||||||
found += append_str(out_str, "you"); /* tack on "or you" */
|
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 */
|
/* Now check for objects */
|
||||||
for (i = 1; i < MAXOCLASSES; i++) {
|
for (i = 1; i < MAXOCLASSES; i++) {
|
||||||
if (sym
|
if (sym
|
||||||
@@ -696,6 +697,7 @@ const char **firstmatch;
|
|||||||
* If we are looking at the screen, follow multiple possibilities or
|
* If we are looking at the screen, follow multiple possibilities or
|
||||||
* an ambiguous explanation by something more detailed.
|
* an ambiguous explanation by something more detailed.
|
||||||
*/
|
*/
|
||||||
|
didlook:
|
||||||
if (looked) {
|
if (looked) {
|
||||||
if (found > 1 || need_to_look) {
|
if (found > 1 || need_to_look) {
|
||||||
char monbuf[BUFSZ];
|
char monbuf[BUFSZ];
|
||||||
|
|||||||
Reference in New Issue
Block a user