From 53be8be3e9a6dd6e550139ae7445a2f77032bdd9 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Mon, 6 Nov 2023 17:14:41 -0500 Subject: [PATCH] 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." --- src/pickup.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pickup.c b/src/pickup.c index df524e476..f258d437c 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -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;