From f0e88bbc6812b933bb0eb8631e8a9d4d1d21d61a Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 6 Mar 2023 16:06:43 -0500 Subject: [PATCH] one more follow-up for #954 --- include/extern.h | 1 + src/read.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/extern.h b/include/extern.h index 17584d0a7..549376858 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2348,6 +2348,7 @@ extern void punish(struct obj *); extern void unpunish(void); extern boolean cant_revive(int *, boolean, struct obj *); extern boolean create_particular(void); +extern boolean avoid_ceiling(d_level *); /* ### rect.c ### */ diff --git a/src/read.c b/src/read.c index 86f8405ae..acab63950 100644 --- a/src/read.c +++ b/src/read.c @@ -52,6 +52,17 @@ static boolean create_particular_parse(char *, struct _create_particular_data *); static boolean create_particular_creation(struct _create_particular_data *); + +boolean +avoid_ceiling(d_level *lev) +{ + if (In_quest(lev) || Is_astralevel(lev) + || Is_firelevel(lev) || !has_ceiling(lev)) + return TRUE; + return FALSE; +} + + static boolean learnscrolltyp(short scrolltyp) { @@ -1802,8 +1813,7 @@ seffect_earth(struct obj **sobjp) if (u.uswallow) { You_hear("rumbling."); } else { - if (!In_quest(&u.uz) - && !Is_astralevel(&u.uz) && !Is_firelevel(&u.uz)) { + if (!avoid_ceiling(&u.uz)) { pline_The("%s rumbles %s you!", ceiling(u.ux, u.uy), sblessed ? "around" : "above"); } else {