]> granicus.if.org Git - nethack/commitdiff
Fix article used for steed when stepping on trap
authorPasi Kallinen <paxed@alt.org>
Sat, 23 Jan 2021 09:25:50 +0000 (11:25 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 23 Jan 2021 09:25:53 +0000 (11:25 +0200)
This was caused by the trap code refactor I did a month ago.

src/trap.c

index ff53aff692643dc7657a7b0e17b67c99e3478dba..792169387592f6891cc34657adfeec5110556566 100644 (file)
@@ -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: