Fix: mention_decor preposition vs unusual terrain

When moving off a body of water with mention_decor on, describe_decor()
would produce messages like "You are back on cloud", "You are back on
wall", and "You are back on air bubble."  For those types of terrain
that were producing odd sentences like this, change the format to "You
are back in a cloud", "You are back in a wall", "You are back in an air
bubble", and "You are back in the air."
This commit is contained in:
Michael Meyer
2023-11-06 17:14:41 -05:00
committed by PatR
parent 702f914306
commit 53be8be3e9

View File

@@ -384,17 +384,22 @@ describe_decor(void)
|| IS_LAVA(iflags.prev_decor)
|| iflags.prev_decor == ICE) {
if (iflags.last_msg != PLNMSG_BACK_ON_GROUND) {
const char *surf = is_ice(u.ux, u.uy)
? ice_descr(u.ux, u.uy, fbuf)
: surface(u.ux, u.uy);
const char *preposit = (Levitation || Flying) ? "over" : "on",
*surf = surface(u.ux, u.uy);
if (!strcmpi(surf, "floor") || !strcmpi(surf, "ground"))
if (is_ice(u.ux, u.uy)) {
surf = ice_descr(u.ux, u.uy, fbuf);
} else if (!strcmpi(surf, "floor")
|| !strcmpi(surf, "ground")) {
surf = "solid ground";
} else { /* "cloud", "air", "air bubble", "wall" */
surf = !strcmp(surf, "air") ? the(surf) : an(surf);
preposit = "in";
}
pline("%s %s %s.",
flags.verbose ? "You are back" : "Back",
(Levitation || Flying) ? "over" : "on", surf);
preposit, surf);
}
}
}
iflags.prev_decor = ltyp;