]> granicus.if.org Git - nethack/commitdiff
sanity_check of steed
authorPatR <rankin@nethack.org>
Wed, 17 Mar 2021 16:14:22 +0000 (09:14 -0700)
committerPatR <rankin@nethack.org>
Wed, 17 Mar 2021 16:14:22 +0000 (09:14 -0700)
For wizard mode sanity_check, add a check for steed's saddle when
hero is riding.

src/mon.c

index f145308bb88c93aad85e5a7b610d5f460a330574..68b650ae9f1ef426a9ccb5bd4502da11679cedb5 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -107,6 +107,18 @@ sanity_check_single_mon(
     /* guardian angel on astral level is tame but has emin rather than edog */
     if (mtmp->mtame && !has_edog(mtmp) && !mtmp->isminion)
         impossible("pet without edog (%s)", msg);
+    /* steed should be tame and saddled */
+    if (mtmp == u.usteed) {
+        const char *ns, *nt = !mtmp->mtame ? "not tame" : 0;
+
+        ns = !m_carrying(mtmp, SADDLE) ? ns = "no saddle"
+             : !which_armor(mtmp, W_SADDLE) ? ns = "saddle not worn"
+               : 0;
+        if (ns || nt)
+            impossible("steed: %s%s%s (%s)",
+                       ns ? ns : "", (ns && nt) ? ", " : "", nt ? nt : "",
+                       msg);
+    }
 
     if (mtmp->mtrapped) {
         if (mtmp->wormno) {