From: Pasi Kallinen Date: Sat, 23 Jan 2021 09:25:50 +0000 (+0200) Subject: Fix article used for steed when stepping on trap X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dd6960cb1a93533181e5fd85723f94e3ae97dff;p=nethack Fix article used for steed when stepping on trap This was caused by the trap code refactor I did a month ago. --- diff --git a/src/trap.c b/src/trap.c index ff53aff69..792169387 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1497,6 +1497,11 @@ unsigned trflags; int steed_article = ARTICLE_THE; int oldumort; + /* suppress article in various steed messages when using its + name (which won't occur when hallucinating) */ + if (u.usteed && has_mgivenname(u.usteed) && !Hallucination) + steed_article = ARTICLE_NONE; + /* KMH -- You can't escape the Sokoban level traps */ if (!Sokoban && (Levitation || (Flying && !plunged))) return 0; @@ -1765,6 +1770,11 @@ unsigned trflags; boolean viasitting = (trflags & VIASITTING) != 0; int steed_article = ARTICLE_THE; + /* suppress article in various steed messages when using its + name (which won't occur when hallucinating) */ + if (u.usteed && has_mgivenname(u.usteed) && !Hallucination) + steed_article = ARTICLE_NONE; + feeltrap(trap); if (mu_maybe_destroy_web(&g.youmonst, webmsgok, trap)) return 0; @@ -2061,6 +2071,11 @@ unsigned trflags; int steed_article = ARTICLE_THE; char verbbuf[BUFSZ]; + /* suppress article in various steed messages when using its + name (which won't occur when hallucinating) */ + if (u.usteed && has_mgivenname(u.usteed) && !Hallucination) + steed_article = ARTICLE_NONE; + seetrap(trap); if (viasitting) Strcpy(verbbuf, "trigger"); /* follows "You sit down." */ @@ -2392,7 +2407,6 @@ unsigned trflags; plunged = (trflags & TOOKPLUNGE) != 0, conj_pit = conjoined_pits(trap, t_at(u.ux0, u.uy0), TRUE), adj_pit = adj_nonconjoined_pit(trap); - int steed_article = ARTICLE_THE; nomul(0); @@ -2428,13 +2442,8 @@ unsigned trflags; } } - if (u.usteed) { + if (u.usteed) u.usteed->mtrapseen |= (1 << (ttype - 1)); - /* suppress article in various steed messages when using its - name (which won't occur when hallucinating) */ - if (has_mgivenname(u.usteed) && !Hallucination) - steed_article = ARTICLE_NONE; - } /* * Note: